How To Suppress Output From Commands In A Batch File

Many times you may want to execute a command line within a batch file without it showing its results on the screen. To do this, redirect the output to Nul

For instance, to copy a file without echoing any results:

copy c:\test.txt c:\test >nul


Note: redirecting to NUL only suppresses Normal output. It does suppress error messages.

To suppress error messages, redirect output to 2>NUL.

For instance, to delete a file and not display any error messages:

del test.txt 2>NUL


You can also combine the two and suppress normal and error messages in one fatal swoop using

>NUL 2>NUL