Saturday, September 26, 2009

Update Modified Timestamp on Windows | Equivalent of Unix touch command

This is a common operation, and there should be a straightforward way to do it. Well, there is one. Suppose myfile.txt is the file in question, you can update its last modified date and time using this in command prompt:
copy /b myfile.txt +,,
The operation may be slow on very large files. There are other ways to do it as well but I find this the simplest one.

More on this is discussed at Stack Overflow.

I came across this by reading Alex Pinsker's blog so many thanks to him for the tip.

No comments: