Is there a way to redirect Windows console commands to nothing\null?

A regular redirection might look like:

prog.exe > a.txt

However in my case I would like to redirect the output so that it will not be written or displayed anywhere.

link|improve this question

49% accept rate
feedback

1 Answer

up vote 7 down vote accepted

Absolutely!

This directs standard output to nul:

prog.exe >nul

This directs errors to nul:

prog.exe 2>nul

This directs both to nul:

prog.exe >nul 2>nul
link|improve this answer
snazzy. this should let me clean up those scripts where i generate a temporary text file to hide output cause i didn't know better ;) – Journeyman Geek Oct 17 '11 at 0:33
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.