Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

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

share|improve this answer

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

share|improve this answer

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"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.