I have an entry in a batch file containing a list of files (this is one line and one of many entries in the bat file):
"\\Server\my directory name\subdir,\\Server\my directory name\subdir2,\\Server\my directory name\subdir3"
I would like to repeat this list and execute the command in each directory in the list. However, when I specify delims =, it treats spaces as delimiters, although the docs say, "Sets the delimiter set. This replaces the default delimiter set and the tab." This does not seem to be a replacement, it just seems. I tried communicating with backq, but this does not seem to work, since the input is already specified.
The closest I can get
for /f "tokens=1-8 delims=," %%d in ("%destPath%") do (
echo %%d
echo %%e
echo .
)
But I have an uv set of input here, so I can get 12 directories and donβt want to have a duplicate line to execute the command (same line n times in the body of the loop), it seems that the target of the for loop wins.
Related: How to get a for loop to work with a comma delimited string?
source
share