Question

I need to execute several batch files one after another, each .bat executing from a different folder. for example I have the following code:

cd test1
oneup.bat
cd test2
oneup.bat
cd test3
oneup.bat

When I execute that code inside the folder containing test1,2 and 3, It executes the first oneup.bat within the test1 folder but then it stops. How can I make it run as intended?

Was it helpful?

Solution 2

cd /d "test1"
call oneup.bat
set a="%cd%"
cd /d "test2"
call "%a%\oneup.bat"
cd /d "test3"
call "%a%\oneup.bat"

this will exec the same batch file in different folders.

OTHER TIPS

cd /d "test1"
call oneup.bat
cd /d "test2"
call oneup.bat
cd /d "test3"
call oneup.bat
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top