At the end of the batch file I have "pause" to keep the window open. However, any time I press any key, as the terminal states, this causes the window to close. I would like to keep the window open so that I can do a search for keywords within the terminal window using CTRL+F. Is there another function besides "pause" that can achieve this?
Thanks for your help on this.
Another way to keep terminal window open
Moderator: DosItHelp
Re: Another way to keep terminal window open
If you have exit commands in your batchfile change these to exit /b
Make a shortcut to your batchfile.
Change the target of the shortcut to:
If you start the batchfile with the shortcut then the window will stay open until you close it or use the exit command.
Make a shortcut to your batchfile.
Change the target of the shortcut to:
Code: Select all
cmd /k fullpathandnameofyourbatchfile.cmd
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Another way to keep terminal window open
Simply run the script from the command prompt instead of double-clicking it and the window will stay open after the script ends.
You're new, so I'll oversimplify - never ever double click scripts!
You're new, so I'll oversimplify - never ever double click scripts!