How to Output Batch Command to Null

How to Output Batch Command to Null
@echo off
mode con:cols=40 lines=2
echo somestring|clip
cls
echo Wireless Password copied to clipboard.
timeout 2 > NULL

How do I make timeout not print any text?

1

2 Answers

You may need to redirect both stdout and stderr:

timeout 2  >NUL  2>NUL

Note that the special device is NUL or NUL:, with a single L.

1

Interesting (and annoying) fact for latest Windows 10: Microsft does not allow piping into nul any longer.

Update: This was a bug in Win10-Insider v18990. It is fixed in v18995.

Your Answer

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

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.