Article ID: 69581 - Last Review: November 16, 2006 - Revision: 2.1 Updating the Date and Time Stamps on Files
This article was previously published under Q69581 SUMMARY
The following MS-DOS command updates the date and time stamps of a file
named "EXAMPLE" without altering the contents of the file. This is similar
to the TOUCH utility found in XENIX and in some third-party MS-DOS
toolkits.
COPY /B EXAMPLE +,, MORE INFORMATION
The COPY command can concatenate a file onto an existing file when
used in the form:
COPY FILE1+FILE2 Therefore, with the above command, the /b forces the COPY command into binary mode, the filename is the file to be updated, the + (plus sign) indicates that a file is to be appended, and the ,, (commas) are placeholders for the remaining parameters (which are not included in this example). Because the file to be appended is not specified, the COPY command will append nothing and only update the time and date stamps for the file. The following batch file, TOUCH.BAT, can be used to automate the process: @echo off if %1.==. goto end if not exist %1 goto end copy /b %1 +,, > nul echo %1 touched! :end APPLIES TO
| Other Resources Other Support Sites
CommunityArticle Translations |






















Back to the top