0

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?

Cpich
  • 17
  • 3

2 Answers2

2
cd /d "test1"
call oneup.bat
cd /d "test2"
call oneup.bat
cd /d "test3"
call oneup.bat
npocmaka
  • 51,748
  • 17
  • 123
  • 166
1
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.

nephi12
  • 2,351
  • 1
  • 15
  • 25