![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Set folder date to newest file I would like to traverse all subfolders of a root and set folder date as the latest file within. Modified date, that is. -- -- HAL07, Engineering Services, Norway |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Set folder date to newest file HAL07 wrote: Quote: > I would like to traverse all subfolders of a root and set folder date > as the latest file within. Modified date, that is. the last modified date to the current date, but cannot "spoof" the date. Regards, Mark D. MacLachlan -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Set folder date to newest file Mark D. MacLachlan wrote: Quote: > HAL07 wrote: > Quote: >> I would like to traverse all subfolders of a root and set folder date >> as the latest file within. Modified date, that is. > I don't beleive this is possible, you can modify the folder to change > the last modified date to the current date, but cannot "spoof" the date. > > Regards, > > Mark D. MacLachlan > $folder = "c:\files" $search = $folder + "\*.*" $a = get-childitem $search | sort-object LastWriteTime | select-object -last 1 $b = Get-Item $folder $b.LastWriteTime = $a.LastWriteTime Bah. That won't help me much. Are you sure it's not possible on vbscript? Powershell is not installed on all my servers, and some servers are beyond my control. -- -- HAL07, Engineering Services, Norway |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Set folder date to newest file HAL07 wrote: Quote: > Mark D. MacLachlan wrote: Quote: > > HAL07 wrote: > > Quote: > > > I would like to traverse all subfolders of a root and set folder > > > date as the latest file within. Modified date, that is. > > I don't beleive this is possible, you can modify the folder to > > change the last modified date to the current date, but cannot > > "spoof" the date. > > > > Regards, > > > > Mark D. MacLachlan > > > $folder = "c:\files" > $search = $folder + "\*.*" > $a = get-childitem $search | sort-object LastWriteTime | > select-object -last 1 $b = Get-Item $folder > $b.LastWriteTime = $a.LastWriteTime > > Bah. That won't help me much. Are you sure it's not possible on > vbscript? Powershell is not installed on all my servers, and some > servers are beyond my control. seems to me it should not work. Anyway, if it does work, you should be able to target remote servers even if they don't have PowerShell. Just reference the remote server via UNC. $folder = "\\remoteserver\c$\files" -- |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| How do I view file date in file open dialogs and Win Explorer | Vista file management | |||
Date Taken Folder Question | General Discussion | |||
| Photo date taken vs. file date | Vista music pictures video | |||
| WMDC Changes File Date When copying file to Laptop | Vista General | |||
| finding the newest file in a directory | PowerShell | |||