copy NUL EmptyFile.txt
DOS has a few special files (devices, actually) that exist in every directory, NUL
being the equivalent of UNIX's /dev/null
: it's a magic file that's always empty and throws away anything you write to it. Here's a list of some others; CON
is occasionally useful as well.
To avoid having any output at all, you can use
copy /y NUL EmptyFile.txt >NUL
/y
prevents copy
from asking a question you can't see when output goes to NUL
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…