Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 7 down vote accepted


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


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.