Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

BOOL WINAPI SetFileTime(
  __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...
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
add comment

Your Answer

 
discard

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