DelAge32, Version 2.0, © 2003-2006, Horst Schaeffer


DelAge32 is a command line tool that deletes or moves files by age (number of days).

The age is calculated as date difference at local time. By default the "last modified" file stamp is taken to calculate the age (see options /created, /modified and the note about file stamps).

Syntax: DelAge32 filespec days [options]
Examples: DelAge32 C:\some\where\*.* 100 /recurse
DelAge32 there\*.tmp 1 /created /includeRO
Delage32 *.zip 35
filespec File name search pattern (wildcards) with full or relative path.
days Number of days: minimum age of files to delete or move
options Options begin with a slash, case ignored.
All command arguments must be separated by blank space!
/preview The files will not be deleted, but only listed with age.
/created The "created" time stamp is taken to calculate the age. Default is the "last modified" stamp. See note about file stamps (below)
/modified The "last modified" time stamp is taken to calculate the age. This is the default. However, when used in conjunction with the /created option, the most recent one of these two stamps is taken.
/accessed The "last access" time stamp is taken to calculate the age.
/includeRO Include files with Read-Only attribute
/includeH Include files with Hidden attribute (system files always remain untouched)
/recurse Recurse through the entire subdirectory structure (see /rd option to remove empty directories)
/subonly Recurse, but exclude the initial directory
/rd Remove empty directories by age (according to "created" stamp)
/move target Move files instead of deleting; specify target directory. This works across drives.
Note: If a target file exists, it will be overwritten without warning!
/quiet No output (makes no sense with the /preview option). By default all deleted or moved files are listed with age (number of days).
Output can be redirected to a file (OEM format).

In case of any syntax errors the program will take no action.
Maximum length of fully expanded paths: 260 bytes.

Errorlevels: 0: successful, even if no files have qualified
1: invalid path, 255: syntax error
Failed operations: If there are any files that could not be deleted or moved, the output line will be marked with *** failed ***.

Note about file stamps:

Usually you would not expect a file to have been "modified" before it was "created".
However, when a file is copied, for example, the new copy is "created" at the current date (obviously), whereas the "last modified" stamp is taken from the original file, because it is supposed to refer to the contents - not the physical file.

History:

ver. 2.0, 2006/07/17 internal redesign
ver. 1.8, 2005/11/10 Options: /accessed, /includeH, /modified in conjunction with /created;
improved /rd handling (preview and "failed" notice)
ver. 1.7, 2005/10/08 /rd option
ver. 1.6, 2005/07/20 fix: file time converted to local for correct date
ver. 1.5, 2005/03/21 /move option
ver. 1.4, 2004/07/12 fix: handling of new attributes (W2K)
ver. 1.3, 2004/02/18 option /created added (by default the age is based on the "last modified date")
ver. 1.2, 2004/02/27 always OEM character set for output UNC paths, 0 days allowed
ver. 1.1, 2004/01/23 OEM character set if output to console
ver. 1.0, 2003/11/14 first release

Copyright, Disclaimer

This program is distributed as "freeware," copyright reserved by the author. There are no warranties of any kind, nor any liability by the author. Users accept full responsibility for the use they make of the software and for any damage caused thereby.

Email: horst.schaeffer@gmx.net
Website: http://home.mnet-online.de/horst.muc

17 Jul 2006