I want to write a batch file with the following requirements:
1. The value in file test.txt is 0 or 1;
2. If the read value is 0, call a.exe, if the read value is 1, call b.exe
This is the batch file I wrote:
FOR /F "delims=" %%a in (test.txt) do if "%%a"=="0" (call a.exe) else call b.exe
When executed under DOS 6.22, it reports a syntax error. Please help rewrite it, thank you!
[ Last edited by kaixin1228 on 2009-9-15 at 22:50 ]
1. The value in file test.txt is 0 or 1;
2. If the read value is 0, call a.exe, if the read value is 1, call b.exe
This is the batch file I wrote:
FOR /F "delims=" %%a in (test.txt) do if "%%a"=="0" (call a.exe) else call b.exe
When executed under DOS 6.22, it reports a syntax error. Please help rewrite it, thank you!
[ Last edited by kaixin1228 on 2009-9-15 at 22:50 ]


