touch.exe is touch for Windows. touch is a standard Unix and Linux command used to change files' access and modification timestamps. It is also used to create new and empty files.

touch.exe is a Win32 console utility and it supports all options listed in the POSIX:2008 touch specification.

Extra touches: it can also change files creation time, has full Unicode support and includes recursive and verbose option. It even lets you pause on exit to so you can run it without cmd.exe!
> Download
> Source code
> Version history
> Usage
> Exit codes
> Author
> Contact
> References


This software is provided to you for free, as is and without warranty.

Version 0.99

Source code

touch.exe is made with C++. Visual Studio 2005 solution and project included. Compile and expand! Send me your cool stuff.

Version 0.99 source code

Version history

  Version 0.99 [2010.09.22]
    * Initial release.
    * This build will become 1.0 if you tell me it's good to go! :)
    * Supports all options listed in the POSIX:2008 touch spec.
    * 100% Unicode.
    * Recursive mode.
    * Verbose mode.
    * Pause on exit (catch output before the window goes away).
    * Extensive manual testing but no automated tests.
    * Tested on WinXP. More to come (Win7).

Usage (touch --help)

Usage: touch [-acmpsRvx] [-r REFFILE | -t TIME | -d DATETIME] FILE...

A FILE argument that does not exist is created empty, unless -c or --no-create
is supplied.

  -a, --access-time        Change file access time.
  -c, --no-create          Do not create any new files.
  -m, --modif-time         Change file modification time.
  -p, --pause-exit         Pause on exit.
  -s, -R, --recursive      Recursively touch files in specified directory and
                           all subdirectories.
  -v, --verbose            Output the result of every file processed.
  -x, --creation-time      Change file creation time.

  -r, --reference REFFILE  Use this file's times instead of current time.
  -t, --time TIME          Use [[CC]YY]MMDDhhmm[.ss] instead of current time.
  -d, --date DATETIME      Use YYYY-MM-DDThh:mm:SS[.frac] instead of
                           current time.

  -h, --help               Display this help and exit.
  --version                Display version information and exit.

Note that the -d and -t options accept different time-date formats.

Mandatory arguments to long options are mandatory for short options too.

Exit codes

0Successful and all requested changes were made.
-1Missing file operand.
-2Cannot retrieve source touch time (-r, -t, -d options or system time error).
> 0If positive, the exit code is the number of files for which the times could not be successfully modified. With the --no-create option, this number includes the files that did not exist and were not created.


touch.exe was written and is maintained by Stéphane Duguay.


To report a bug, request a feature or send me cool modifs:
s (@) binarez (.) com


* POSIX:2008 touch specification
* POSIX:2008
* touch on Wikipedia