Brother willsort, hello!
At the DOS7.10 command line, the current directory is C:, and C: has three TXT files: 1.txt,2.txt,3.txt. D: also has three TXT files, 4.txt,5.txt,6.txt. I want to compare them. I type:
for %1 in (*.txt) do command /c for %2 in (d:\*.txt) do fc %1 %2>>abc
Then the problem appears: the contents of abc are:
1.txt compared with 4.txt
............(normal)
1.txt compared with 5.txt
Cannot find file 5.txt (the current directory is C:, so at this point it treats d:\5.txt as c:\5.txt, so it can't find it! In other words, in the FOR loop command, from the second time on it ignores d:\ and treats it as being in the current directory!!)
1.txt compared with 6.txt
Likewise it cannot find file 6.txt... and the same below...
That is to say, in the FOR loop, the first round is normal, and the rest all go wrong!
However, I'm doing this at the command line; I haven't tried it in a batch file yet, but it should be the same, right?
Second, when I use %comspec% /c instead of command /c, it says syntax error, strange!!
What's going on?
Also, at the XP command line, this problem does not occur, everything is normal.