Take the 2-minute tour ×

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 stackoverflow.com Oct 16 '11 at 12:06

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

add comment

3 Answers

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
add comment

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
add comment

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...

  -a                     change only the access time
  -c                     do not create any files
  -f                     (ignored)
  -m                     change only the modification 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
add comment

Your Answer

