header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Clearing file dates/times
Last Post 22 Jul 2010 11:42 PM by absolutebeginner. 4 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
absolutebeginnerUser is Offline
New Member
New Member
Posts:14
Avatar

--
22 Jul 2010 08:59 AM
    Hello, how can I get PS to delete/clear the LastWriteTime and LastAccessTime of files, so that only the CreationTime remains? Thanks a lot.
    PoSherLifeUser is Offline
    Basic Member
    Basic Member
    Posts:364
    Avatar

    --
    22 Jul 2010 09:39 AM
    you can use the CreationTime property to with set_LastWriteTime and set_LastAccessTime you can reset the LastWriteTime and LastAccessTime.

    gci c:\temp | % {$_.set_LastWriteTime($_.CreationTime);$_.set_LastAccessTime($_.CreationTime)}

    I can't find any ways to remove completely the properties your looking for.
    When at first you don't succeed Step-Into

    http://theposherlife.blogspot.com
    http://www.jandctravels.com

    absolutebeginnerUser is Offline
    New Member
    New Member
    Posts:14
    Avatar

    --
    22 Jul 2010 11:55 AM
    Thanks. That's just as good.
    One problem: If I try that on folders I get an error message that the process can't access the folders as they are in use. Do you know how I can circumvent that?
    PoSherLifeUser is Offline
    Basic Member
    Basic Member
    Posts:364
    Avatar

    --
    22 Jul 2010 01:10 PM
    gci c:\temp | ? { $_.PSIsContainer -ne $true } | % {$_.set_LastWriteTime($_.CreationTime);$_.set_LastAccessTime($_.CreationTime)}
    When at first you don't succeed Step-Into

    http://theposherlife.blogspot.com
    http://www.jandctravels.com

    absolutebeginnerUser is Offline
    New Member
    New Member
    Posts:14
    Avatar

    --
    22 Jul 2010 11:42 PM
    Thanks.
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer