I was trying to use this excellent answer.
Is there a way to have ONE command line that executes the following (delete all files of size zero) without printing any output?
for /r %F in (*) do if %~zF==0 del "%F"
(It shows all the expanded commands, also when the size is not zero)
I have tried to use How to redirect stderr to null in cmd.exe, (trying >, 1> and 2>) with no avail...
The
> NUL
is because I can't recall if certain situations causedel
to try to output@
suppresses the output for one command. So the following does what you want:To show (only) the files that were deleted: