kyleshire
asked on
What Windows command to check the filenames for 0 size and delete the files
Hi,
I am looking for command (internal or external) to write a simple batch file to see if a file has 0 byte size and to delete it. Any help is appreciated!!
Thanks!
I am looking for command (internal or external) to write a simple batch file to see if a file has 0 byte size and to delete it. Any help is appreciated!!
Thanks!
Try this out and see if it works for you....
@echo off
call :deleteIfEmpty "yourFileName"
exit /b
:deleteIfEmpty
if %~z1 eq 0 del %1
exit /b
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
On vista/win7/8/8.1 you have forfiles.exe built-in. It knows the @fsize filter which will serve your need.