The NUL device is useful for supressing "Press any key to continue"
Long time scripters will, I'm sure, know this. Useful to mention as I was writing a script over the long weekend (it was memorial day here in the US yesterday - makes up for the many UK bank holidays I've missed over the past couple of months!) which needed a "pause" in it, but as this was for a non-tech savvy user, I wanted to indicate that they could also press Control-C to terminate the script there and then.
If you have test.cmd with the following contents:
@echo off
echo Example 1
echo Press any key to continue or Control-C to terminate script . . .
pause
the output won't be quite what you may want:
C:>test
Example 1
Press any key to continue or Control-C to terminate script . . .
Press any key to continue . . .
To resolve this, simply add a > NUL onto the second pause:
@echo off
echo Example 2
echo Press any key to continue or Control-C to terminate script . . .
pause > NUL
to give the following output.
C:>test
Example 2
Press any key to continue or Control-C to terminate script . . .
Cheers,
John.