If you are writing a batch file and you don’t want to continue until somebody presses a key, you can do it really easy with the timeout command.

For instance, using the following on the command prompt will pause the terminal for 10 seconds unless you press a key:

timeout /t 10

Whereas this command will pause the terminal for 30 seconds whether you press a key or not:

timeout /t 30 /nobreak

And this one will pause forever until you press a key:

timeout /t -1

Lowell Heddings Lowell Heddings
Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people.
Read Full Bio »