I've got an input to a batch file that contains a list of files (this is all one line and one of many inputs to the bat file):
"\\Server\my directory name\subdir,\\Server\my directory name\subdir2,\\Server\my directory name\subdir3"
I'd like to iterate this list and perform a command on each directory in the list. However, when I specify delims=, it treats the spaces as delimiters, even though the docs say "Specifies a delimiter set. This replaces the default delimiter set of space and tab." Doesn't seem to be replacing, just seems to be adding to. I've tried messing around with backq but that doesn't seem to work, since the input is already quoted.
The closest I can get is
for /f "tokens=1-8 delims=," %%d in ("%destPath%") do (
echo %%d
echo %%e
echo .
)
But I have an uknown set of inputs here, so I could be getting 12 directories coming in and don't want to have a repeated line for the command execution (same line n times in the loop body), seems to defeat the purpose of a for loop.