You are visitor number since 2 August 2006
Go to Howard Kaikow's home page
Copyright © 2006-2007 by Howard Kaikow. All rights reserved.
Date: 16 July 2007
Author: Howard Kaikow <email@example.com>
Subject: Change File Times Program
Download the latest version of the Change File Times Program
Also, see the Change Path Times ("Path Times") program
There are circumstances in which "incorrect" file times are recorded. These include:
The Change File Times ("FileTimes") program may be used to change the Access, Creation, and Modification times for a file. The program should work with either a file or a directory file.
When changing times for directories, you should change times for each subdirectory before you change times for the parent directory.
The Change Path Times program cheats and makes a second pass on the directories, hoping to reduce this problem.
The Change File Times program is designed to work on one file at a time. In batch processing mode, you might be able to cheat by sorting the batch file appropriately.
The program was compiled using Microsoft Visual Basic 6 (with SP 6).
In order to run this program, you will need to have the following installed:
Windows 2000, or later.
Either Microsoft Visual Basic 6 or the Microsoft Visual Basic 6 run-time files: If you have neither, then you can download the Visual Basic 6 run-time files by following the instructions in VBRun60.exe Installs Visual Basic 6.0 Run-Time Files.
Microsoft Windows Common Controls-2 6.0 (MSCOMCT2.OCX): If MSCOMCT2.OCX is not installed on your system, you can download Microsoft Windows Common Controls-2 6.0 from http://activex.microsoft.com/controls/vb6/MSCOMCT2.CAB. If MSCOMCT2.OCX is not installed, MSCOMCT2.OCX will be installed when ChangeFileTimes.exe is installed.
I have developed the program using Microsoft Windows 2000. The program will not work on operating systems older than Microsoft Windows 2000.
The Forms used by this program were designed using a screen resolution of 1280 x 1024, hopefully, there will be no problems at other screen resolutions.
Run the program InstallChangeFileTimes.exe.
The program will be installed in a directory of your choosing and will be assigned to the Howard Kaikow group in the Start menu.
The program may be uninstalled from Add/Remove Programs in the Control Panel.
The program creates a log file named LogChangeFileTimes.txt. The file will be created in the directory in which ChangeFileTimes.exe is installed. If the file does not exist, the file will be created by the program. If the file exists, the program will append to the end of the file.
The log file is very important, and should be checked after running the program. The log file lists the times that were changed, and any errors encountered. If you inadvertently change a file time, the information in the log file may be used to restore the file times to a one second resolution.
You may run the program from the Start menu, or by double-clicking on the ChangeFileTimes.exe file, or by using a shortcut to that file.
When you run the program, a Form will be displayed that looks something like the following.
If you select Process batch, you will be asked to identify a file listing the changes you wish to make.
If you select Copy file times, or Copy directory times, you will be asked to select a file/directory for which the times are to be modified and a file/directory from which the times are to be copied. A Form will be displayed that looks something like the following.
If you select Change file times, or Change directory times, you will be asked to select a file/directory for which the times are to be modified. A Form will be displayed that looks something like the following.
You also may select Copy file times, or Copy directory times, and then select, as appropriate, Change file times or Change directory times.
|Enforce time order||If checked, the program will not change a time if Modification Time is earler than Creation Time, or if Access Time is earler than either Creation Time or Modification Time.|
If unchecked, a time will be recorded only if it is different than the original time.
If checked, a further comparison will be made using a resolution of one second.
If checked, the file's new Creation Time may be changed when the Change Times button is used.
If unchecked, the new Creation Time will be set to the original Creation Time, and the Creation Time will not be changed when the Change Times button is used.
If checked, the file's new Modification
Time may be changed when the Change
Times button is used.
If unchecked, the new Modification Time will be set to the original Modification Time, and the Modification Time will not be changed when the Change Times button is used.
If checked, the file's new Access Time may
be changed when the Change Times button is
If unchecked, the new Access Time will be set to the original Access Time, and the Access Time will not be changed when the Change Times button is used.
|Back||Select another file or directory file.|
|Exit||Exit the program.|
|Change the selected times. The times for the file are not changed until the Change Times button is used.|
|Original||Lists the times currently recorded for the file.|
|Lists the times that may be recorded for the file when the Change Times button is used. Several mechanisms are provided for selecting the new file times.|
|Date and Time Pickers||
Set a new time.
Each part of the date and time is treated as a separate field. If you highlight a field, you can use the up and down arrow keys to change the value of the field. In addition, if you click on the down arrow next to the date, a calendar can be used to select a date.
|Now||Sets the new time to the current time. Behavior depends on whether Enforce date order is checked.|
|Sets the new time to the UTC for the original time.|
|Access||Sets the new Creation Time, or Modification Time, to the new Access Time.|
|Creation||Sets the new Access Time, or Modification Time, to the new Creation Time.|
|Modification||Sets the new Access Time, or Creation Time, to the new Modification Time.|
For each of the file times, you may choose a new time as follows:
It is not possible to preserve the full accuracy of a recorded time value using typical user interfaces.
For example, when you select a file, "7/4/2006 01:29:10" might be displayed for a file time. However, the internal respresentation is more precise than a one second resolution.
If you use the Date and Time Picker, or any other, controls to change the time, and then use the Date and Time Picker controls to reset back to the original time, it is highly likely that the result will be different than the internal respresentation for the original time.
If you check the Preserve Resolution control, the program willl compare the new and original times, and not make a change if there is no difference using a one second resolution.
If you uncheck the Preserve Resolution control, you may inadvertently change a time by reducing the accuracy of its internal representation.
If you wish to set a new time to the original time, uncheck the box used to select the time to be changed.
If you wish to set a new time to the UTC time, use the UTC button.
If you wish to set a new time to the current time, use the Now button.
If you selected Process batch, you must identify a Batch File listing all the changes you wish to make.
The program will process each record in the Batch File. The LogChangeFileTimes.txt file will indicate the outcome of processing each record.
Each record must be terminated with a CARRIAGE RETURN character followed by a LINE FEED character.
Each parameter in each record must be separated from any following parameter in the record by a TAB character.
A record will be ignored if any duplicate or erroneous parameter is detected.
How to specify
Placing a SEMICOLON character at the beginning of a record will cause the record to be ignored.
The file for which times are to be modified is the Destination file. All records must identify a Destination file
The Destination file is identified by D=filespec, where filespec is the full file path, including the filename and filename extension, not enclosed in quote characters.
The file from which times are to be copied is the Source file. A record may identify a Source file only if it is intended to copy the times from the Source file to the Destination file.
The Source file is identified by S=filespec, where filespec is the full file path, including the filename and filename extension, not enclosed in quote characters.
|Copying the times from the Source file to the Destination file.||
If you have identified a Source file, you may identify which of the times are to be copied.
The times may be identified using a single parameter consisting of one, or more, with no duplicates, of the following:
If this parameter is omitted, all three times will be copied.
Changing the times in the Destination file when a Source file is not identified.
If you have not identified a Source file, you must identify which of the times are to be changed.
The times are identified using a separate parameter for each time, with no duplicates, as follows: