"David S" <
boot...@optonline.net> wrote in message
news:5ae4be18-477d-44de...@c1g2000yql.googlegroups.com...
Not surprising
for /f "delims=" %%a in ('dir *.jpg *.zip *.txt /a-d /b') DO
if "%%~za" == "0" del "%%a"
( all as one line )
1/ Missing DO
2/ %%~za to get the size of file %%a, not %~z1
3/ "%%a" not %file% In all probability, FILE is not an assigned variable, so
%file% will be replaced by NOTHING. Even if it did exist AND contained a
valid filename, you would be attempting to delete that file for each
0-length file found. Quotes around %%a not necessary, but advisable to cater
for spaces and other special characters in the filename %%a.
And I'm not sure whether the size reported for a file that is in the process
of being created is zero until it's closed by the generating program...