windows batch delete script
Posted on 2011-10-21
Hello all. I need script similar to the one below which searches for files beginning with z and deletes them if less than a certain file size but...
unlike the script below, I have a known directory and I do not want to search the whole hard drive to save time.
so the the script should delete all files that start with z, and LSS 7043000 , from this known path
for %%D in (C D E F G H I J K) do (
for /F "tokens=*" %%P in ('if exist %%D: dir /a:-d /s/b %%D:\~* ^| findstr /L /i \qagame\') do (
if %%~zP LSS 7043000 del /s /q "%%~P"