Checking If A File Is Zero Byte in Windows batch

@echo off
setlocal
set FILE=%1
if not exist %FILE% goto :END
for /f "tokens=1-5" %%a in ('dir %FILE%') do call :CHECKFILE %%a %%b %%c %%d %%e
goto :END
:CHECKFILE
if not {%5}=={%FILE%} goto :EOF
if {%4}=={0} ( echo It's a zero byte file! ) else ( echo It's not a zero byte file )
goto :EOF
:END

Comments

Popular posts from this blog

City Code Table for Casio SGW300HD-1AV Watch

How to force only 4G or LTE network connection for Samsung Galaxy Note 4

Mounting NFS share directory from D-link DNS 320L on Ubuntu 12.04 LTS