A Windows implementation of the UNIX touch utility that updates file and folder timestamps.
This utility sets the LastAccessed, DateModified, and Created timestamps of files (and optionally folders) to the current time. It's useful for updating file modification times without actually modifying the file contents.
- Visual Studio 2022 (or compatible version)
- Windows SDK
- Open
touch.slnin Visual Studio - Select Release configuration (this is the default)
- Build the solution (F7 or Build → Build Solution)
- The executable
touch.exewill be created in the same folder as the solution file
Alternatively, build from the command line:
msbuild touch.sln /p:Configuration=Release
touch [options] [filespec]
-r- Recursively process subdirectories-v- Verbose mode (show old/new timestamps)-f- Touch folders as well as files
Touch all .exe files in current directory:
touch *.exe
Touch all .txt files recursively:
touch -r *.txt
Touch a file with verbose output:
touch -v readme.md
Touch all files and folders in current directory:
touch -f *
Touch all files and folders recursively:
touch -r -f
Touch all .log files and folders recursively with verbose output:
touch -r -v -f *.log
- Running
touchwithout any arguments displays usage information - The default filespec (if not specified) is
*(all files) - Timestamps are set to the current system time
- Requires appropriate permissions to modify file/folder timestamps
This is free software. Use it as you wish.