Posted by drumsticks on May 02, 2008 at 12:44:35:
In Reply to: Parsing a path with FOR command in DOS posted by drumsticks on May 02, 2008 at 12:15:41:
It looks like if I have this command within an IF statement, then it will not working properly.
I had an IF statement wrapped around the FOR command like so:
IF EXIST %path% (
REM do some command
) ELSE (
FOR /F "usebackq tokens=1,2,3,4 delims=\" %%G IN (%path%) DO (SET drive=%%G&SET webserver=%%H&SET secondDir=%%I&SET thirdDir=%%J)
REM drive: %drive%
REM webserver: %webserver%
REM secondDir: %secondDir%
REM thirdDir: %thirdDir%
)
So, it seems like this IF statement is restricting the variables from getting instantiated with the parsed path data. Is there something wrong with this, or is this some sort of bug maybe?
Thanks for any input!