+ Post New Thread
Results 1 to 9 of 9
Windows Thread, Change folder creation date in Technical; I need to write a script to change the 'creation date' on a folder. I can do it manually using ...
  1. #1
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Change folder creation date

    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 !

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,820
    Thank Post
    110
    Thanked 590 Times in 511 Posts
    Blog Entries
    1
    Rep Power
    226

    Re: Change folder creation date


  3. #3
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: Change folder creation date

    Touch only updates the access / modification times, not the created time.

  4. #4

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,820
    Thank Post
    110
    Thanked 590 Times in 511 Posts
    Blog Entries
    1
    Rep Power
    226

    Re: Change folder creation date

    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.

  5. #5
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: Change folder creation date

    OK, can you give me the syntax to use touch to change the date on a folder?

  6. #6

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,820
    Thank Post
    110
    Thanked 590 Times in 511 Posts
    Blog Entries
    1
    Rep Power
    226

    Re: Change folder creation date

    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

  7. #7
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: Change folder creation date

    Thanks Geoff, I'll give that a go...

  8. #8
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: Change folder creation date

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

  9. #9

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,820
    Thank Post
    110
    Thanked 590 Times in 511 Posts
    Blog Entries
    1
    Rep Power
    226

    Re: Change folder creation date

    My bad. I have cygwin on this machine. The way my path is setup I was inadvertantly running the cygwin version.

SHARE:
+ Post New Thread

Similar Threads

  1. Bulk folder creation
    By richard in forum How do you do....it?
    Replies: 3
    Last Post: 5th November 2007, 02:04 PM
  2. Mass Home Folder Creation?
    By Blind in forum Windows
    Replies: 11
    Last Post: 1st September 2007, 08:05 PM
  3. Bulk folder Creation in Windows
    By scgf in forum How do you do....it?
    Replies: 21
    Last Post: 26th April 2007, 04:05 PM
  4. Replies: 4
    Last Post: 21st January 2007, 09:48 PM
  5. Replies: 5
    Last Post: 10th January 2007, 02:55 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •