How to nest commands in Batch FOR statement on multiple lines
Posted on 2004-09-23
Can anyone tell me what is wrong with this code? Is it possible to nest and If withing a FOR? The %1 var is a file with 2 string per line, a source and destination path. I am trying to check if the destination path begins with a '\'. The code works if I cram it on one line. I was hoping to do it on multiple lines. Any suggestions?
for /F "tokens=1,2 skip=1 delims= " %%A in (%1) do (
if %strB:~0,1% NEQ "\" (
echo ERROR: DESTINATION PATH IN MANIFEST FILE MUST BEGIN WITH '\' >> %strLogName%