DelOld—delete old files
Table of contents
for this article
General information
DelOld is a program that deletes files that are older than a specified number of days. DelOld is called from a command line and requires at least two arguments, the folder and possibly file name (can contain the wildcard characters * and ?) and the minimum age of the files to be deleted.
DelOld is freeware.
DelOld does not require installation. Just copy the executable program file onto your hard disk.
See also Microsoft's addition to some resource kits and to Windows Server 2003 of a similar command line tool: ForFiles. Read a description with sample batch files here.
Version 2 instructions for use
DelOld 2 has been rewritten in Java and has improved window display behavior and should run on all platforms that support Java. It requires the Java SE Runtime Environment (JRE) version 5 or higher, which you have to download and install.
The Java version consists only of one executable Java file: DelOld.jar
If there experience any problems with the DelOld.jar file on Windows, which happens only if the Java SE Runtime Environment is damaged or not installed, you can download the somewhat bigger DelOld.exe instead. This variant will direct you to the Java SE Runtime Environment download if it is not already installed.
In the command line you have to enter at least two parameters:
- The file path in which old files are to be deleted.
The path can be absolute with or without a drive letter or relative to the current folder. It can end in a file name, which may include the wildcard characters ? and *.
Examples:
C:\TEMP
C:\TEMP\
temp
temp\*.log
\TEMP\datalog.*
If the path contains spaces, enclose it in quotes.
Example (1 line):
"C:\Documents and Settings\All Users\Application Data\Log files"
This argument can appear more than once, i.e. you can enter multiple, different paths.
- The number of days before a file will be deleted.
This always has to be the last argument in the command line.
Examples for proper DelOld calls:
DelOld.jar C:\TEMP 60
DelOld.exe \TEMP\*.tmp 1
DelOld.jar D:\Users\Mike\Garbage 33
DelOld.jar "C:\TEMP\User Logs\" 8
DelOld.exe \TEMP 3
DelOld.jar C:\TEMP D:\TEMP 14
You can call the program from a Program Manager icon. In this case put the complete call line including the two parameters into the call command line. You can also put the icon into your Startup group for automatic operation.
In Windows NT, 2000, and XP you can start it from a batch file.
Examples:
start /low /wait DelOld.jar C:\TEMP\ 1
start /low /wait DelOld.exe C:\TEMP D:\TEMP 7
start /low /wait DelOld.jar "C:\Users\DJ\My Documents\Throw away\" 66
start /low /wait DelOld.jar "C:\TEMP\User Logs\*.log" 8
DelOld will display what it has done. It will stay on screen briefly after finishing its work plus some more seconds for each file actually deleted, so you can quickly get a glimpse of what it has done. Then it will close itself automatically.
If you want to stop it before it deletes any files, click on the [Pause] button. You can then either click on the [Continue] button to have the files deleted or on the [Abort] button to abort the program and keep the files. Note that you have only between 4 and 8 seconds, depending on the number of files (1 file: 4 seconds, 9 or more files: 8 seconds).
If the same file appears in more than one folder argument, it will be listed multiple times, but it will still be deleted without error message.
If you cannot start a JAR file directly in spite of Java version 5 or higher being installed, then the Java installation is damaged. You have the following ways to proceed.
- Reinstall the Java SE Runtime Environment (JRE).
- Precede the command line with:
javaw -jar
or with:
java -jar
Example (1 line):
java -jar delold.jar "C:\TEMP\Log files" 30
- Repair the association of JAR files in Windows.
- Open Windows Explorer
- Click on the commands: Tools, Folder Options, File Types
- Search for: JAR
- If JAR is not in the list, click on the [New] button and enter it. Click on the [Advanced>>] button and link it to the file type: Executable Jar File
- If JAR is in the list, check its settings. The procedure is too complicated to explain here, but you may have success with removing the file type JAR and recreating it as explained above. If this fails, use one of the above methods.
Version 1 instructions for use
DelOld will not automatically operate on subdirectories, only on the directory you specify. But of course you can call DelOld several times with several directories, file names and file ages.
DelOld 1 requires MSVBVM60.DLL (1.34 MB) however, which you can download from the World Wide Web after using any of the search engines for the file name, for example through Alta Vista or any other good Web search system.
In Windows 95 copy MSVBVM60.DLL into the SYSTEM subdirectory. In Windows NT, 2000, and XP copy it into the SYSTEM32 subdirectory.
The distribution packet for DelOld 1, deloldx.exe, contains the following files.
DelOld.vbp (Visual Basic source)
DelOld.frm (Visual Basic source)
DelOld.frx (Visual Basic source)
DelOld.bas (Visual Basic source)
DelOld.txt (these instructions for use)
DelOld.exe (executable program)
If you want to modify the program, have a look at DelOld.vbp first. It's a text file. Some paths might be different on your computer.
In the command line you have to enter two parameters:
- The file path in which old files are to be deleted, including the
file name or file name wildcards complete with drive letter.
Example: C:\TEMP\*.*If the path contains spaces, enclose it in quotes.
Example: "C:\Documents and Settings\All Users\Application Data\X\*.*" - The number of days before a file will be deleted.
Examples for proper DELOLD calls:
DELOLD.EXE C:\TEMP\*.* 60
DELOLD C:\TEMP\*.TMP 1
DELOLD C:\TEMP\~*.* 2
DELOLD D:\USERS\MIKE\GARBAGE\*.* 33
DELOLD "C:\TEMP\User Logs\*.log" 8
You can call the program from a Program Manager icon. In this case put the complete call line including the two parameters into the call command line. You can also put the icon into your Startup group for automatic operation.
In newer versions of Windows you can start it from a batch file. The following examples presume that the program is somewhere in the operating system's search path. If this is not the case, you have to prefix DelOld with its path:
start /low /wait DelOld C:\TEMP\*.TMP 1
start /low /wait DelOld C:\TEMP\~*.* 1
start /low /wait DelOld C:\TEMP\*.* 66
start /low /wait DelOld "C:\TEMP\User Logs\*.log" 8
DelOld will display what it has done. It will stay on screen briefly after finishing its work plus some more seconds for each file actually deleted, so you can quickly get a glimpse of what it has done. Then it will close itself automatically.
Recent comments
1 hour 25 min ago
10 hours 27 min ago
3 days 7 hours ago
6 days 11 hours ago
6 days 18 hours ago
1 week 2 hours ago
1 week 2 hours ago
1 week 3 days ago
1 week 3 days ago
1 week 3 days ago