How to ensure full path in Windows batch FOR loop
- by palswim
I've created a generic batch (or Windows Command) file that lets me loop through the contents of a directory and call a command for each item.
IF a%1==a ( set _DIR="%CD%") ELSE ( set _DIR="%~1")
IF a%2==a ( set _COMMAND=rem) ELSE ( set _COMMAND=%2)
IF a%3==a ( set _FILTER=*.*) ELSE ( set _FILTER=%3)
set _OPTS=%4
FOR /F "delims=" %%f IN ('dir…