Download on SourceForge

waRmZip.wsf v1.7 (Nov 2005)
Utility to clean up/free up space in a folder (and its subfolders),
* compressing files after a certain number of days (with external program)
* rotating files after a certain number of days/above a certain size
* deleting files and/or empty folders after a certain period of time
* moving files to other folders/disks
___________________________________________


Usage: waRmZip.wsf BASE [/ca:value] [/cp:value] [/cpp:value] [/ce:value]
 [/da:value] [/dc] [/df] [/dr] [/ma:value] [/md:value] [/mb] [/ra:value]
 [/rn:value] [/rp:value] [/fo:value] [/fn:value] [/gt:value] [/lt:value]
 [/r] [/nh] [/t] [/v] [/q] [/log:value]

Options:

  • BASE : base folder where cleanup starts 
  • /ca : compress files after X days 
  • /cp : compress program - command line 
  • /cpp : compress program - command parameters 
  • /ce : compressed file extension 
  • /da : delete files after X days 
  • /dc : delete compressed files too after X days 
  • /df : delete empty folders - only when /r is used 
  • /dr : delete read-only files/folders 
  • /ma : move files after X days 
  • /md : move files to this folder (can be local or UNC)
    the following keywords are substituted:
    $YEAR: YYYY, $MONTH: YYYYMM, $DAY: YYYYMMDD, $HOUR: HH, $COMP: COMPUTERNAME, $WEEKDAY: 1-7 
    e.g: /md:F:\backup\$COMP\logfiles\$DAY 
  • /mb : backup mode - do not delete file after moving 
  • /ra : rotate files after X days (creation date!) 
  • /rn : rotate & create new empty file after rotation 
  • /rp : rotation prefix - D:YYYYMMDD 
  • /fo : filter only - only process files with extension 
  • /fn : filter not - don’t process files with extension 
  • /gt : greater than- only process when larger than 
  • /lt : lesser than - only process when smaller than 
  • /r : recursive - also process subfolders 
  • /nh : no hidden - do not process hidden files/folders 
  • /t : test mode - don’t actually process files - just show what would be done 
  • /v : verbose - show debug output during execution 
  • /q : quiet - no output during execution log
  • /logfile - write output to file
    if filename=’D’ use [script name].YYYYMMDD.log as log file
    if filename=’M’ use [script name].YYYYMM.log as log file
    if no filename given use [script name].log as log file

Examples:

  • waRmZip.wsf /r “C:\Inetpub\ftproot” /da:7 /df /dr /log:c:\Inetpub\ftp_cleanup.log
    clean up FTP folders - delete all files older than 7 days and empty folders, even if read-only 
  • waRmZip.wsf /r /f:.log “C:\WINNT\system32\Logfiles” /da:30 /dc /ca:14 /log:d
    compress all log files older than 14 days, delete all files older than 30 days 
  • waRmZip.wsf /r “C:\Temp” /da:1 /df /q
    delete all files older than 1 day, don’t show output 
  • waRmZip.wsf “d:\server\log” /ra:7 /fo:.txt /gt:1MB /log:d
    rotate all .txt files greater than 1MB created more than 7 days ago 
  • waRmZip.wsf /r /f:.log “C:\WINNT\system32\Logfiles” /ma:7 /md:f:\backup\$YEAR\$COMP\$DAY\IIS
    move all log files older than 7 days to folder F:\backup\2004\server1\20040101\IIS 
  • waRmZip.wsf /r /f:.log “C:\WINNT\system32\Logfiles” /ca:14 /cp:”c:\Program Files\7-Zip\7za.exe” /cpp:”a -tzip $out $in”
    compress all log files older than 14 days with 7-Zip