Change File Date and Time in MS-DOS 6.22

In MS-DOS 6.22, there is no dedicated touch utility to update timestamps, but you can natively alter a file's date and time record using the COPY command. By using a specific concatenation syntax with commas, MS-DOS updates the file's directory entry to the current system date and time without modifying the file's contents.

The Native Command

To update the timestamp of an existing file to the current system date and time, use the following syntax at the command prompt:

COPY /B filename.ext +,,

How the Syntax Works

  • COPY: The standard MS-DOS file copying utility.
  • /B: Specifies binary mode. This prevents the command from interpreting an end-of-file character (Ctrl+Z / ASCII 26) as the end of the file, ensuring that binary files (such as .EXE or .COM) are not truncated or corrupted.
  • filename.ext: The name of the file whose timestamp you want to update.
  • +,,: The plus sign instructs COPY to concatenate files. The two commas act as dummy place-holders for additional source and destination parameters. Because no additional files are specified, MS-DOS rewrites the file in place without changing its data, which forces the operating system to update the timestamp in the directory table.

Setting a Specific Date and Time

Because the COPY command writes the current system date and time to the file, you must temporarily change the system clock if you need to apply a specific historical or future timestamp:

  1. Type DATE and enter the desired date (e.g., 05-12-1994).
  2. Type TIME and enter the desired time (e.g., 12:00:00).
  3. Run COPY /B filename.ext +,, to apply the updated time.
  4. Use DATE and TIME again to restore the system clock to the correct values.

File System Considerations

MS-DOS 6.22 uses the standard FAT16 file system, which only records a single modification timestamp per directory entry rather than separate creation, access, and modification dates. Running this command updates the only native timestamp available for the file.