Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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
share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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