4

i have a bat file that has the following it:

sm start "Schedule"

this code runs but the command window closes immediately

what can i put inside the bat file to keep the window open?

Alex Gordon
  • 455
  • 3
  • 14
  • 31

3 Answers3

6

Just put the command pause in the batch file at the end.

Chopper3
  • 101,299
  • 9
  • 108
  • 239
2

Or you can run it with cmd /k mybatfile.bat instead of cmd mybatfile.bat. Very useful if you can't edit the file or want to invoke a quick command from Run. F.e.: cmd /k ipconfig

Bart De Vos
  • 17,911
  • 6
  • 63
  • 82
0

I don't know what "sm" or "Schedule" are. But if "start" is cmd.exe's integrated start command, you may be looking for:

sm start /wait "Schedule"
Bill Gates
  • 237
  • 1
  • 1