0

I want to execute a batch file from another batch file and I have been successful in doing so but the problem is once the 2nd batch is executed the 1st batch window closes. I want to keep the first batch window to stay open

The command I am using is :

1st.bat :

2nd.bat "path"

pause
Ajit
  • 1
  • try `call 2nd.bat "path"` – Jean-François Fabre Aug 22 '16 at 15:30
  • There is no 1st and 2nd console (batch) window in your approach; calling `2nd.bat` like you do runs that file in the *same* console window (context), but when finished, execution does *not return* to `1st.bat`, unless you use the `call` command like this: `call 2nd.bat "path"`... – aschipfl Aug 22 '16 at 15:36
  • 2
    Possible duplicate of [How to run multiple .BAT files within a .BAT file](http://stackoverflow.com/questions/1103994/how-to-run-multiple-bat-files-within-a-bat-file) – aschipfl Aug 22 '16 at 15:40
  • thanks @Jean-FrançoisFabre it worked – Ajit Aug 23 '16 at 13:36

1 Answers1

0

Try this:

start "windowname" "file.bat"

Sorry if this doesn't work; I'm currently using a mobile phone.

Matthew Horvath
  • 186
  • 1
  • 12