ajbritton Posted November 15, 2005 Posted November 15, 2005 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 !
Geoff Posted November 15, 2005 Posted November 15, 2005 http://unxutils.sourceforge.net/ You want touch.exe
ajbritton Posted November 15, 2005 Author Posted November 15, 2005 Touch only updates the access / modification times, not the created time.
Geoff Posted November 15, 2005 Posted November 15, 2005 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.
ajbritton Posted November 15, 2005 Author Posted November 15, 2005 OK, can you give me the syntax to use touch to change the date on a folder?
Geoff Posted November 15, 2005 Posted November 15, 2005 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 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 test 0 File(s) 0 bytes 1 Dir(s) 22,417,858,560 bytes free
ajbritton Posted November 15, 2005 Author Posted November 15, 2005 Thanks Geoff, I'll give that a go...
ajbritton Posted November 15, 2005 Author Posted November 15, 2005 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 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> What am I doing wrong? Incidentally, I tried TOUCHing a file, and sure enough, the 'Modified' and 'Accessed' dates change, but the 'Created' date does not.
Geoff Posted November 16, 2005 Posted November 16, 2005 My bad. I have cygwin on this machine. The way my path is setup I was inadvertantly running the cygwin version.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now