Normally I would have to call a command once per folder like this:
processdata.cmd C:\data\10-2-2019-run1
processdata.cmd C:\data\10-2-2019-run2
processdata.cmd C:\data\10-2-2019-run3
etc.
I want to write a for loop that will run that command once per folder and append the directory just like in the commands above
I don't want it to loop through sub-folders
The only folders there contain data, so I don't need it to exclude any folders or files.
Just a very simple For loop using windows CMD (preferably not powershell)
How can I do this?
Thanks,
2 Answers
Try this.
for /D %G in ("c:\data\*") do processdata.cmd "%~fG"
Normally I would have to call a command once per folder like this:
processdata.cmd C:\data\10-2-2019-run1
processdata.cmd C:\data\10-2-2019-run2
2