How to Change a File Date With DOS

By Eric Hammer

Changing the date on a file is possible with a single-line command directly from the DOS prompt. For those not familiar with the DOS prompt, DOS, which stands for Disk Operating System, was a predecessor to Windows and for a time was the backbone of the Windows operating system (Windows ran on top of DOS). As of September 2010, the DOS prompt can still be accessed from Windows and allows you to enter commands directly into the computer using typed commands rather than clicking and pasting.

Step 1

Click the "Start" button. In the "Search" field, type "command prompt." Press "Enter." (Note: Windows XP and previous users should click "Run," type "CMD" and press "Enter.")

Step 2

Navigate to the folder where the file is located that you wish to change. Use the CD command to do so (i.e., if you needed to switch to "C:\My Documents," you would type "cd c:\my documents." Note that in Windows Vista/7, there is no need to enter an underscore between words in a long file name (i.e., you don't have to type "my_documents.").

Step 3

Type "Copy [nameoffile] /B + ,, /Y." Replace [nameoffile] with the name of the file you wish change. If you wanted to change a file named "document.doc," you would type "copy document.doc /B + ,, /Y." This will overwrite your file's old date stamp with the current date. If you would prefer to change the date to a different date, see Tips.

Tips & Warnings

  • The method described will change the date to the date currently set on your computer. However, if for some reason you want to change the date to a different date, either before or after today's date, you will have to first change the system date and then change it back.
  • Type "Date [DD-MM-YY]." Replace "[DD-MM-YY]" with the date you'd like to set. For example, if you want your file to be set to January 1, 2000, you would type "Date 01-01-00." Note that you can specify four digits for the year. If you specify two digits, the system makes a logical assumption (i.e., if you were to enter "date 01-01-89" it would set the date for January 1, 1989). However, were you to enter "date 01-01-30," it would set the date to January 1, 2030. This can be overridden by entering the full four digits. If you want to set the date to January 1, 1930, you would enter "Date 01-01-1930."
  • Once you have finished setting the date to the date you want, you should then follow the instructions above to set the date on the file. Then, simply reset the system date to the current date as previously described.
  • Be sure to enter the commands exactly as written above. Making any change whatsoever could have unpredictable results.