Change File Timestamps in MS-DOS 6.22
MS-DOS 6.22 does not include a dedicated standalone utility (such as
Unix's touch) to directly alter file timestamp flags.
However, users can modify file date and time stamps natively using the
built-in COPY command in combination with the
DATE and TIME commands, or by using low-level
tools like DEBUG.EXE. For advanced timestamp manipulation,
users historically relied on external third-party DOS utilities.
Understanding MS-DOS 6.22 Timestamps
In the standard FAT16 file system used by MS-DOS 6.22, files store a single primary timestamp representing the last modification date and time. Separate "creation" and "last accessed" time flags were introduced later with VFAT in Windows 95. Under MS-DOS 6.22, changing a file's timestamp applies directly to this directory entry's modification record.
The Native Method: The
COPY Command
The standard native method to change a file's timestamp in MS-DOS 6.22 is to concatenate the file to itself using the binary switch. This forces DOS to update the directory record to the current system clock:
COPY /B FILENAME.EXT +,,
To set a specific custom timestamp using native commands:
- Change the system date and time using the
DATEandTIMEcommands. - Execute the
COPY /B FILENAME.EXT +,,command on the target file. - Reset the system clock back to the current date and time.
Low-Level Modification:
DEBUG.EXE
Power users who required direct timestamp manipulation without
altering the system clock utilized DEBUG.EXE. By
interfacing with MS-DOS interrupt INT 21h, Function
5701h (Set File Date and Time), a user could write a
minimal routine to alter the packed time and date bits directly in the
file's handle:
- Bits 0–4: Seconds (divided by 2)
- Bits 5–10: Minutes (0–59)
- Bits 11–15: Hours (0–23)
- Bits 0–4 (Date): Day (1–31)
- Bits 5–8 (Date): Month (1–12)
- Bits 9–15 (Date): Year (offset from 1980)
Third-Party Utilities
Because native tools were cumbersome for routine batch operations, the standard practice in the MS-DOS 6.22 era was to use external third-party utilities:
- TOUCH.EXE: Distributed with developer suites (such
as Borland C++ or Microsoft Macro Assembler), this tool replicated the
Unix
touchfunctionality. - Norton Utilities (
FA/FILEFIND): Allowed interactive or batch modification of file attributes, dates, and times directly from the DOS prompt. - PC Tools: Offered file management interfaces with direct field editing for file directory entries.