TOUCH - Change date and time stamps
Purpose: Change a file's date and time stamps.
Format: TOUCH [/C /D[acw][mm-dd-yy] /E /F /Q /T[acw][hh:mm]] file ...
file : One or more files whose date and/or time stamps are
to be changed.
/C(reate file) /F(orce read-only files)
/D(ate) /Q(uiet)
/E (no Error messages) /T(ime)
See also: LIST.
File Selection
Supports extended wildcards, ranges, multiple file names, and include
lists.
Usage
TOUCH is used to change the date and/or time of a file. You can use it
to be sure that particular files are included or excluded from an
internal command, backup program, compiler MAKE utility, or other program
that selects files based on their time and date stamps, or to set a group
of files to the same date and time for consistency.
TOUCH should be used with caution, and in most cases should only be used
on files you create. Many programs depend on file dates and times to
perform their work properly. In addition, many software manufacturers
use file dates and times to signify version numbers. Indiscriminate
changes to date and time stamps can lead to confusion or incorrect
behavior of other software.
TOUCH normally works with existing files, and will display an error if
the file you specify does not exist, or has the read-only attribute set.
To create the file if it does not already exist, use the /C switch. To
force a date and time change for read-only files, use the /F switch.
TOUCH displays the date, time, and full name of each file whose timestamp
is modified. To disable this output, use /Q.
If you don't specify a date or a time, TOUCH will default to the current
date and time from your system clock. For example, to set the time stamp
of all .C files in the current directory to the current date and time:
[d:\source] touch *.c
6-12-97 11:13:58 D:\SOURCE\MAIN.C
6-12-97 11:13:58 D:\SOURCE\INIT.C
...
If you specify a date but not a time, the time will default to the
current time from your system clock. Similarly, if you specify a time
but not a date, the date will be obtained from the system clock.
On HPFS files, TOUCH sets the "modified" or "last write" date and time by
default. By adding the appropriate character to the /D or /T switch, you
can set the other date and time stamps that are maintained for each file:
a last access date and time.
c creation date and time
w last write date and time (default)
Options
/C: (Create file) Create the file (as a zero-byte file) if it does
not already exist. You cannot use wildcards with /C, but you
can create multiple files by listing them individually on the
command line.
/D: (Date) Specify the date that will be set for the selected
files. If the date is not specified, TOUCH will use the
current date. For HPFS files you can use /Da, /Dc, or /Dw,
followed by the date, to explicitly specify the last access,
creation, or last write date stamp. The date must be entered
using the proper format for your current country settings.
/E: (No error messages) Suppress all non-fatal error messages,
such as "File not found." Fatal error messages, such as
"Drive not ready," will still be displayed. This option is
most useful in batch files.
/F: (Force read-only files) Remove the read-only attribute from
each file before changing the date and time, and restore it
afterwards. Without /F, attempting to change the date and
time on a read-only file will usually cause an error.
/Q: (Quiet) Do not dislpy the new date and time and the full name
for each file.
/T: (Time) Specify the time that will be set for the selected
files, in hh:mm format. If the time is not specified, TOUCH
will use the current time. For HPFS files you can use /Ta,
/Tc, or /Tw, followed by the time, to explicitly specify the
last access, creation, or last write time stamp.
Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs