Find in Folder / Subfolder SWF file512KB

November 16, 2009 at 01:27:58
Specs: Windows XP
Hi all, do you guys know how to write a batch file that:-

1) Search for (*.swf) in "e:\example and its sub folders (recursively)" which is greater than 512KB in size and then if the swf file or files is / are found, delete it / them.


See More: Find in Folder / Subfolder SWF file512KB

Report •

November 16, 2009 at 02:57:16
searching for files and deleting them according to size, date, etc is such a common task its beneficial to use specialized tool that does just that. If you can download stuff, you can use GNU find (see my sig)

c:\test> gnu_find.exe e:\path -type f -size +512k -delete

GNU win32 packages | Gawk

Report •

November 16, 2009 at 07:39:14
@echo off & setLocal EnableDELAYedExpansion

pushd e:\example

for /f "tokens=* delims= " %%a in ('dir/s/b/a-d *.swf') do (
if %%~Za gtr 512000 (
del "%%a"

Helping others achieve escape felicity


Report •

November 17, 2009 at 02:07:44
GNU find looks easier to me. By the way, I usually rename GNU find to gfind.exe to prevent confusion with Windows find.exe. Also, M2's "512000" should be 524288, assuming by "K" you mean 1024.

Report •

Related Solutions

November 18, 2009 at 00:01:00
you guys are the fast and furious!!! glad great guys like u rule!!! thanks alot!!!

Report •

Ask Question