@echo off REM http://stackoverflow.com/questions/6764621/delete-files-less-than-a-specific-size REM http://stackoverflow.com/questions/483864/windows-command-for-file-size-only#483923 REM http://weblogs.asp.net/jongalloway//top-10-dos-batch-tips-yes-dos-batch REM http://www.robvanderwoude.com/battech_booleanlogic.php REM set targserver=\\blt03-tsgapps set testsize=600000 REM NET USE z: %targserver%\apps REM echo %%~z1 = %~z1 REM If %~z1 LSS 800000 echo "%%1" is too small less than 3k "%%~z1" IF %~z1 LSS %testsize% goto abort IF %~z1 GTR %testsize% goto happy goto cleanup goto :eof :abort echo "%1" is too small "%~z1" REM other commands go here set whether2do=no echo %whether2do% goto cleanup goto :eof :happy echo "%1" is a good size "%~z1" set whether2do=yes echo %whether2do% goto cleanup goto :eof :cleanup REM NET USE z: /delete