I think you want NUL.
For example:
type c:autoexec.bat > NUL
doesn't create a file.
According to this message on the GCC mailing list, you can use the file "nul" instead of /dev/null:
#include <stdio.h>
int main ()
{
FILE* outfile = fopen ("/dev/null", "w");
if (outfile == NULL)
{
fputs ("could not open '/dev/null'", stderr);
}
outfile = fopen ("nul", "w");
if (outfile == NULL)
{
fputs ("could not open 'nul'", stderr);
}
return 0;
}
(Credits to Danny for this code; copy-pasted from his message.)
You can also use this special "nul" file through redirection.
Jon Skeet is correct. Here is the Nul Device Driver page in the Windows Embedded docs (i have no idea why its not somewhere else...) HEre is another
Maybe someone will get interested: here is a /dev/random and /dev/zero device drivers for Win32.
What is the equivalent to /dev/null in Windows?