How do I get my batch file to use timeout /nobreak without displaying in the program "waiting for one seconds, press CTRL+C to quit"?

1 Answer

You can redirect the command's output to the Nul device like this:

TIMEOUT 1 /NOBREAK >NUL 

For most commands, adding >nul to the end of the command will redirect the command's standard output to the Nul device which simply discards the output. Some output, particularly error output will still be written to the screen.

If you'd like to pause indefinitely, use:

PAUSE >NUL 

Or can go one step further and provide a custom message:

ECHO Press your favorite key to continue... PAUSE >NUL 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy