John said:
Anyone know how to create a batch file that will give you the size of a file
and execute a task. For example if a zip file is less than 1mb delete it.
- - - - - - - begin screen capture WinXP MCE 2005 SP2 - - - - - - -
c:\cmd>dir \download\*.zip
Volume in drive C has no label.
Volume Serial Number is 44E5-91F9
Directory of c:\download
02/28/2006 08:36 AM 285,580 Autoruns.zip
04/03/2006 03:51 PM 86,723 getkv11.zip
04/09/2006 03:58 PM 109,615 hosts.zip
03/29/2006 01:20 PM 2,202,048 monad_b3_1_50727_x86.zip
03/29/2006 01:20 PM 266,830 monad_b3_docs.zip
02/01/2006 06:42 PM 739,932 private.zip
02/28/2006 08:32 AM 648,737 ProcessExplorerNt.zip
02/02/2006 02:36 PM 592,469 PsTools.zip
02/02/2006 02:35 PM 24,249 SDelete.zip
02/27/2006 11:13 PM 1,442,494 sonicencoders.zip
04/07/2006 09:34 PM 3,803,503 why_ruby_sucks_PPT.zip
02/01/2006 06:42 PM 636,111 xyplorer_full.zip
12 File(s) 10,838,291 bytes
0 Dir(s) 218,477,404,160 bytes free
c:\cmd>for %a in (c:\download\*.zip) do @if %~za lss 1000000 echo
deleting %~ta %~za %~fa
deleting 02/28/2006 08:36 AM 285580 c:\Download\Autoruns.zip
deleting 04/03/2006 03:51 PM 86723 c:\Download\getkv11.zip
deleting 04/09/2006 03:58 PM 109615 c:\Download\hosts.zip
deleting 03/29/2006 01:20 PM 266830 c:\Download\monad_b3_docs.zip
deleting 02/01/2006 06:42 PM 739932 c:\Download\private.zip
deleting 02/28/2006 08:32 AM 648737 c:\Download\ProcessExplorerNt.zip
deleting 02/02/2006 02:36 PM 592469 c:\Download\PsTools.zip
deleting 02/02/2006 02:35 PM 24249 c:\Download\SDelete.zip
deleting 02/01/2006 06:42 PM 636111 c:\Download\xyplorer_full.zip
- - - - - - - end screen capture WinXP MCE 2005 SP2 - - - - - - -