I need some help. I am trying to delete zero byte files. I have a process in my scheduler that starts a job if a file exists however it does not check to see if there is any data in the file.
how do I delete a zero byte file in DOS?
deleting zero byte files
Moderator: DosItHelp
Look here: http://dostips.cmdtips.com/DtCodeSnippets.php#_Toc136272773
or here: http://dostips.cmdtips.com/DtCodeSnippets.php#_Toc136272772
DOS IT HELP ?
Code: Select all
set file=filename.txt
dir "%file%"|find /i " 0 %file%">NUL&&(
echo.%file% has ZERO bytes and can be deleted)
or here: http://dostips.cmdtips.com/DtCodeSnippets.php#_Toc136272772
Code: Select all
set file=filename.txt
for %%a in ("%file%") do if %%~za==0 echo.%file% has ZERO bytes and can be deleted
DOS IT HELP ?