Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Where can I get the touch utility for Windows?

I have tried this one at CodeProject but it did not change directorys.

share|improve this question
up vote 3 down vote accepted

you can use powershell to do this as well. I have the following function in my $profile

function touch([string] $filename)
$curTime = Get-Date
$touchFile = get-item $filename
$touchFile.CreationTime = $curTime
$touchFile.LastAccessTime = $curTime
$touchFile.lastWriteTime = $curTime
share|improve this answer
I think that this could be extended to allow the date to be supplied – benPearce Jun 10 '09 at 5:22

There are several solutions at

While most of them suggest getting Cygwin (my bias too) or some other unix utilities, there is one answer describing a windows method.

copy /b filename.ext +,,

Another simple solution from the same answer is to get the Cygwin.dll and touch.exe copied locally in your windows system. It will work better if you want to process directories recursively.

share|improve this answer
how does this copy command allow you to change the date time stamp – benPearce Jun 10 '09 at 2:11
The /b treats the file as binary and the +,, tell it to copy the file back to the same place effectively updating the timestamp. But, since you ask, i prefer the Cygwin, touch.exe method. – nik Jun 10 '09 at 2:15
but that only allows you to set the timestamp to now – benPearce Jun 10 '09 at 2:47
Ah, you should use the Cygwin method with touch then -- it will be touch -t [[CC]]YY]MMDDhhmm[.ss]. – nik Jun 10 '09 at 3:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.