Check File for Zero Bytes

Use FOR command to show or delete empty files.

Description: Use the `z` specifier of FOR variable references to get the size of a file. Then show or delete the file if the size is zero.
Script:
1.
2.
set "filemask=myfile*.txt"
for %%A in (%filemask%) do if %%~zA==0 echo."%%A" is empty
Script Output:
 DOS Script Output
"myfile2.txt" is empty
"myfile7.txt" is empty
"myfile8.txt" is empty