G
Guest
I have loved playing with batch files since way, way back in the early DOS
days, and thought I knew most of the tricks & workarounds, but this one has
me completely stumped. I've been tweaking and playing with it for so long
now, I've got a splitting headache!
Under XP SP2, if I run this command in a batch file:
for /R c:\install %%I in (*.*) do if exist "d:%%~pnI" (echo yes) else (echo
no)
the output looks like this:
if exist "d:\install\abc.def" (echo yes ) else (echo no )
if exist "d:\install\ghi.jkl" (echo yes ) else (echo no )
In fact, no matter what I put after the "do if exist" part of the command,
it just displays it and does not execute it. Obviously, I'm trying to do
something more elaborate than just ehcoing yes or no, but I've simplified it
for now just to get it to work.
What the heck am I missing here?
days, and thought I knew most of the tricks & workarounds, but this one has
me completely stumped. I've been tweaking and playing with it for so long
now, I've got a splitting headache!
Under XP SP2, if I run this command in a batch file:
for /R c:\install %%I in (*.*) do if exist "d:%%~pnI" (echo yes) else (echo
no)
the output looks like this:
if exist "d:\install\abc.def" (echo yes ) else (echo no )
if exist "d:\install\ghi.jkl" (echo yes ) else (echo no )
In fact, no matter what I put after the "do if exist" part of the command,
it just displays it and does not execute it. Obviously, I'm trying to do
something more elaborate than just ehcoing yes or no, but I've simplified it
for now just to get it to work.
What the heck am I missing here?