I have a program that does something to a folder. From the Command Prompt, I just need to type in the following to achieve what I need:
program.exe C:foldersubfolder1
However, now I need to do this for multiple subfolders in C:folder
:
program.exe subfolder1
program.exe subfolder2
program.exe subfolder3
...
program.exe subfoldern
I wrote a batch script but it keeps adding %i
to the end of my subfolder path.
This is what I have:
for /r %%i in (%%i) do program.exe %%i
The result is almost what I want, except the %i
at the end of the path
program.exe subfolder1\%i
program.exe subfolder2\%i
program.exe subfolder3\%i
...
program.exe subfoldern\%i
How do I fix this so that the \%i
is not in the path of my subfolder?
question from:
https://stackoverflow.com/questions/66054632/batch-script-to-do-operation-on-all-subfolders 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…