TOUCH.EXE
Go Up to Command-Line Utilities Index
TOUCH.EXE sets the date and time of the listed files to be your system's current (or specified) date and time.
Command-Line Syntax
touch [<options>] <filename> [<filename>...]
If TOUCH cannot find a file that matches the name you specify, it creates a zero-length file with the correct date stamp. To suppress automatic file creation, use the -c
option.
TOUCH accepts long file names. <filename>
can contain the wildcard characters *
and ?
to "touch" more than a single file at a time. Use the -s
option to update matching files in all subdirectories.
Before you use TOUCH, make sure your system's internal clock is set correctly.
Command-Line Options
TOUCH.EXE supports the command-line options listed in the following table:
TOUCH Command Line Options
Option | Description |
---|---|
-h -h2 |
|
-c |
Do not generate the file if it does not already exist. The default is to create it. |
-D |
Allows directory names to be "touch"ed (when wildcards specified). |
-d -t |
Sets the date or/and time of the file to the specified date or/and time.
Supported ranges of parameters are:
For example, -t1231235911 //month=12, day=31, hour=23, minute=59, year=11 (year=2011) -d0102030400 //month=01, day=02, hour=03, minute=04, year=99 (year=1999) -t12/31/11 //month=12, day=31, year=11 (year=2011) -d12-31-11 //month=12, day=31, year=11 (year=2011) -d12:31:11 //hour=12, minute=31, second=11 |
-n |
Lists files. The |
-r<filename> |
Sets the time and date of the files specified in the command line to match the time and date of the |
-s |
Recurses through subdirectories. |
-v |
Verbose mode. Shows each file that has been "touch"ed. |
-w |
Warns about unlocatable files and bad time values. The default is to warn. |
-a, -f, -m |
|