|
Answer» I have a problem with a customer batch file which I have narrowed down to a one liner. The line in the batch file is:
for /F %%I in ( ' dir /b ' ) do echo -- %%I
On a couple of my XP (plus SP2) systems (with the most recent UPDATES already applied), when I start a DOS command prompt and start this batch file, it immediately terminates not only the batch file, but the DOS command prompt as well. This problem doesn't happen if I kick off the batch file with a "start" or "cmd.exe /c". My other systems (also XP plus SP2 and the same level of updates) do not have this problem. Any ideas? Only suggestion I can make it to check the properties of EITHER the cmd window or the shortcuts used to launch the cmd window. COMPARE the systems that work with those that don't.
I seem to remember another post with this same problem. You might try doing a forum search
As written, that batch code will only READ up to the first space of file names with spaces, and why have you got all those extra spaces in the code?
this will read filenames with spaces
for /F "delims==" %%I in ( 'dir /b' ) do echo %%I
|