You want touch.exe
I need to write a script to change the 'creation date' on a folder. I can do it manually using something like Attribute Changer, but I need to do it by script. It can be VBS or CMD. Help !
You want touch.exe
Touch only updates the access / modification times, not the created time.
Linux has no notion of file creation times.
Windows has no notion of file access times.
If you use touch.exe to modify the file access time, you end up altering the creation time. Non-obvious but it works here.
OK, can you give me the syntax to use touch to change the date on a folder?
Code:C:>mkdir test C:\>dir tes* Volume in drive C has no label. Volume Serial Number is 3872-15DD Directory of C:\ 15/11/2005 16:46 <DIR> test 0 File(s) 0 bytes 1 Dir(s) 22,417,858,560 bytes free C:\>time The current time is: 16:46:54.61 Enter the new time: 18:46 C:\>touch -a test C:\>dir tes* Volume in drive C has no label. Volume Serial Number is 3872-15DD Directory of C:\ 15/11/2005 18:47 <DIR> test 0 File(s) 0 bytes 1 Dir(s) 22,417,858,560 bytes free
Thanks Geoff, I'll give that a go...
What am I doing wrong?Code:D:\TEMP\UnxUtils\usr\local\wbin>mkdir touchtest D:\TEMP\UnxUtils\usr\local\wbin>dir touchtes* Volume in drive D is Data Volume Serial Number is 1891-F909 Directory of D:\TEMP\UnxUtils\usr\local\wbin 15/11/2005 21:15 <DIR> touchtest 0 File(s) 0 bytes 1 Dir(s) 7,943,389,184 bytes free D:\TEMP\UnxUtils\usr\local\wbin>touch -a touchtest touch: touchtest: Permission denied D:\TEMP\UnxUtils\usr\local\wbin>
Incidentally, I tried TOUCHing a file, and sure enough, the 'Modified' and 'Accessed' dates change, but the 'Created' date does not.
My bad. I have cygwin on this machine. The way my path is setup I was inadvertantly running the cygwin version.
There are currently 1 users browsing this thread. (0 members and 1 guests)