DelAge32/64, Version 2.56, © 2003-2020, 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 (each date determined 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 path or relative path based on the current directory. Quote marks recommended; required if path includes space or other special characters.
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 or moved, but only listed with age.
/created The "created" time stamp is taken to calculate the age. Default is the "modified" stamp. See note about file stamps (below)
/modified The "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
/includeS Include files with System attribute
/includeRHS = /includeRO /includeH /includeS
/recurse Recurse through the entire subdirectory structure (see /rd option to remove empty directories)
/subonly Recurse, but exclude the initial directory
/rd Remove empty subdirectories regardless of age (initial directory will not be removed).
Note: /preview will not make any /rd predictions.
/move target Move files instead of deleting; specify target directory. This works across drives.
Empty directories will not be created.
Note: If a target file exists, it will be overwritten without warning!
/ANSIout
/UTF8out
/UTF16out
Character encoding options for output redirection to a file: ANSI, UTF-8, UTF-16;
default is /UTF8out
/quiet No output (makes no sense with the /preview option).

By default the console output lists all deleted or moved files with their age (number of days).
The output can be redirected to a file according to console conventions (as UTF-8 text by default).

In case of any syntax errors the program will take no action.

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 that a file has 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.

Deleting folders:

Delage32 deletes files, and optionally removes empty folders. Delage32 was not designed to delete directory structures depending on the age of the folder, regardless of the age of the files inside.

Output character encoding:

Delage32 handles UNICODE file names and paths internally, and displays all file names correctly, provided that the characters are included in the UNICODE version of your console font. For redirection to a file special ecnoding options are provided (default: UTF-8). Files are written without BOM ("byte order mark")

CMD script code page:

If your CMD script includes non-ASCII characters (in file names, for example), you have to take care that the code page (CHCP command) matches the character encoding produced by your text editor (ANSI, UTF-8, legacy OEM). For details see CodePage.txt included in the download package.

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 at gmail.com
Website: https://www.horstmuc.de
Top
08 Dec 2020