Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all.
I need to create a batch file that starts a program with a file name as a patameter. After it finishes, i want to activate the program again on a file with the same name but in the next folder in the directory.
For example the parameter file name is test.xml, and i have 3 such files in 3 separate folders. The program name is prog.exe it should look something like that:
prog.exe c:\test\1\test.xml
And then...
prog.exe c:\test\2\test.xml
etc.
Also, Do i have to know the number of folders in the directory or there's a way to activate it on all the folders in a directory?
Thanks for your advice and time

dj4400
Posted

1 solution

Something like:
for /d %x in (*) do echo prog.exe %x\test.xml
 
Share this answer
 
Comments
dj4400 4-Jun-15 7:27am    
Thanks Richard
Can you please explain your solution?
Richard MacCutchan 4-Jun-15 10:02am    
What is there to explain? Type that at a command prompt (without the echo) to see what the results are. Type for /? for more detailed information.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900