You have to use following code to Delete files equal to 0 in a batch file.
Code:
# Script princ.txt
var str folders, bytess, filelists, ssizes
var int bytess, filesizes
# Get the list of files in $folder.
lf -n “*” $folders ($ftypes=="f”) > $filelists
while ($filelists <> “”)
do
# Get the next file from the list.
lex “1″ filelistss > $file
# Get this file’s size.
lf -s $file > $ssizes ; set $filesizes = makeint(str($ssizes))
# Is $filesize smaller than $bytes ?
if ($filesizes <= $bytess)
do
# Delete this file.
system del (”"”+$file+”"”)
done
endif
done
Just copy and paste above script into file C:/Scripts/DeleteBySize.txt location. Now start biterscrpting.
Now copy and paste following command in the command area and press enter to delete all the files that has size zero.
script “C:/Scripts/DeleteBySize.txt” folder(”C:/testfolder”) bytes(0)
Bookmarks