I found this question, which is very similar to what I want but I just couldn't get it to work.
I want to run process.exe on each subdirectory's XML directory of C:\ToProcess. If I did it by hand, the first 6 of the 50 or so commands would look like this:
process.exe -switch1 -switch2 -i "C:\ToProcess\abx\XML" -o "C:\Processed\abx\XML"
process.exe -switch1 -switch2 -i "C:\ToProcess\dez\XML" -o "C:\Processed\dez\XML"
process.exe -switch1 -switch2 -i "C:\ToProcess\ghm\XML" -o "C:\Processed\ghm\XML"
process.exe -switch1 -switch2 -i "C:\ToProcess\jkq\XML" -o "C:\Processed\jkq\XML"
process.exe -switch1 -switch2 -i "C:\ToProcess\mn0\XML" -o "C:\Processed\mn0\XML"
process.exe -switch1 -switch2 -i "C:\ToProcess\pq2\XML" -o "C:\Processed\pq2\XML"
But before running those commands, I would have to do this, because the target folders do not yet exist:
md "C:\Processed\abx"
md "C:\Processed\dez"
md "C:\Processed\ghm"
md "C:\Processed\jkq"
md "C:\Processed\mn0"
md "C:\Processed\pq2"
md "C:\Processed\abx\XML"
md "C:\Processed\dez\XML"
md "C:\Processed\ghm\XML"
md "C:\Processed\jkq\XML"
md "C:\Processed\mn0\XML"
md "C:\Processed\pq2\XML"
So, is there a way to do all this in just a couple commands?