A
Arnold
How can I delete a 0 size file from the command prompt?
(The name can is different every day and I want to run a
script to clean it up)
(The name can is different every day and I want to run a
script to clean it up)
How can I delete a 0 size file from the command prompt?
(The name can is different every day and I want to run a
script to clean it up)
Very interesting tip. But,what about the wisdom of deleting zero lengthJerold said:Assuming the folder is called C:\Folder
Using FileSize from tip 5725 in the 'Tips & Tricks' at http://www.jsiinc.com
@echo off
setlocal
pushd C:\folder
for /f "Tokens=*" %%f in ('dir /a /a-d /b') do (
call :test "%%f"
)
popd
endlocal
goto :EOF
:test
set file=%1
call FileSize %file% size
if %size% NEQ 0 goto :EOF
del /q /f %file%
Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com