Introduction to delold

delold is a command line and gui tool available for windows systems that is used to very simply delete old files. Within server environments, this tool is extremely handy. When you have processes that write out a new log file every day, if you do not clean up those log files, then over time, your harddrive can fill up.

Obtaining delold

You can download delold from my server below. Note that there are 2 different versions floating around so I have included them both:


Simply download it and unzip it to the directory of your choice, such as the C: drive.

Using delold from the command line

Setting the switches sets the relevant items on the GUI.

If you type a path without any files then it just sets the initial location, if you enter a file spec at the end of the path it will also set the file type to check for (you can set multiple file types by entering a comma between them but DON'T add a space, e.g. delold d:\temp\*.tmp,*.exe is fine).

The /q is quiet mode and when used with /-c (to turn off confirmation) then no GUI will be displayed and the operation will take place with no user intervention. If you do not use the /q switch then all other options can be set and you then need to press the 'Delete!' key to start the process.

You can add '-' to any switch to disable it. This is most useful for /c which is set by default.

You could schedule checks with the Windows NT scheduler when using the /q and /-c switches to automatically delete old files at specified times. An example submission would be

F:\> at 20:00 cmd /c delold /l /q /-c /n:90 /s /d d:\temp\*.tmp

The above would run the program at 8:00 p.m. with no user input (the /q and /-c) for any *.tmp file over 90 days old (/n:90) under d:\temp and all its subdirectories (/s). It would also delete any empty directories (/d) older than 90 days.

If you want to use from the command line without having to enter the path of delold.exe every time you can modify NT's path variable to included the DelOld program location.

  1. Start the System control panel applet (Start - Settings - Control Panel - System)
  2. Select the Advanced tab and click 'Environment Variables'
  3. Select either the user or system variables and double click on Path
  4. At the end of the path add
    ;D:\Program Files\DelOld\
    (or whatever your Program Files program directory is)
  5. Click OK
  6. Click OK to the main environment variables window
  7. Close the System Properties

Modified date, Creation Date, and Accessed Date

  • Creation - When the file is created in the current location
  • Modification - When the file was last modified
  • Accessed - The last time the file/folder was accessed

If you therefore copy a file across volume boundaries it will be given a new creation date but its modification date will be preserved hence giving a creation date which is newer than its modification date.