Super User is a question and answer site for computer enthusiasts and power users. 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

I have a few ZIP files in a folder; I want to change their modified date to three days ago. How do I do that?

My operating system is Windows Vista.

share|improve this question

migrated from Oct 16 '11 at 12:06

This question came from our site for professional and enthusiast programmers.

I'll assume that this is a programming question (even though it isn't). In this case, you would use the SetFileTime function of WinAPI with your file handle.

  __in      HANDLE hFile,
  __in_opt  const FILETIME *lpCreationTime,
  __in_opt  const FILETIME *lpLastAccessTime,
  __in_opt  const FILETIME *lpLastWriteTime
share|improve this answer

You can use BulkFileChanger from Nirsoft for this purpose.

If you want to change the file time programmatically you can use the SetFileTime function. To convert between different time formats you can use TzSpecificLocalTimeToSystemTime and SystemTimeToFileTime. In order to get a handle to the file use CreateFile.

share|improve this answer

UnxUtils is one of many tool sets which has ported the handy (pun intended) touch tool with several options and switches:

touch --help
Usage: touch [OPTION]... FILE...
Update the access and modification times of each FILE to the current time.

  -a                     change only the access time
  -c                     do not create any files
  -d, --date=STRING      parse STRING and use it instead of current time
  -f                     (ignored)
  -m                     change only the modification time
  -r, --reference=FILE   use this file's times instead of current time
  -t STAMP               use MMDDhhmm[[CC]YY][.ss] instead of current time
      --time=WORD        access -a, atime -a, mtime -m, modify -m, use -a
      --help             display this help and exit
      --version          output version information and exit

STAMP may be used without -t if none of -drt, nor --, are used.
share|improve this answer

You must log in to answer this question.