I have four or so files that I would like to "reset" their Created, Modified, Accessed attributes to a specific date and time once those specific files (in certain directories) are opened/used/accessed etc.
Is there a way to do this with AHK so that it monitors these files and once "finished with" the C/M/A attributes can be applied to. E.g.:
My Documents\Test\file1.txt
My Documents\Test\file2.doc
My Documents\Test\file3.gif
These 3 files were all created on 25 Sep 2004 at 13:00:00
If I were to open any or all of the above listed files today, I want AHK to reset the attributes to 25 Sep 2004 at 13:00:00.
Anyone help me out please?
Thanks very much.

Reset Created/Accessed/Modified attribute
Started by
IconBoy
, Jul 04 2006 11:35 PM
1 reply to this topic
#1
-
Posted 04 July 2006 - 11:35 PM

getFileTimes(file,byref ftCreate,byref ftAccess,byref ftModify) { hFile:=dllCall("CreateFileA", "str",file, "uint",0x80000000, "uint",1|2, "uint",0, "uint",3, "uint",0, "uint",0) ifEqual,hFile,-1, return dllCall("GetFileTime", "uint",hFile, "int64p",ftCreate, "int64p",ftAccess, "int64p",ftModify) dllCall("CloseHandle", "uint",hFile) return true } setFileTimes(file, ftCreate, ftAccess, ftModify) { hFile:=dllCall("CreateFileA", "str",file, "uint",0xC0000000, "uint",1|2, "uint",0, "uint",3, "uint",0, "uint",0) ifEqual,hFile,-1, return dllCall("SetFileTime", "uint",hFile, "int64p",ftCreate, "int64p",ftAccess, "int64p",ftModify) dllCall("CloseHandle", "uint",hFile) return true }
usage:
file=D:\someFolder\someFile.txt getFileTimes(file,ftC,ftA,ftM) ;processing Fileappend,HEYHO!!!!,%file% ;..................... ;..................... setFileTimes(file,ftC,ftA,ftM)
#2
-
Posted 05 July 2006 - 08:38 AM
