![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | Find most recent subfolders I have a folder containing some number of subfolders with names derived from dates, each of them created on that date: yyyy-mm-dd For example: /myfolder/ .../2009-04-18/ .../2009-04-25/ .../2009-05-02/ .../2009-05-09/ I want to find the most recent two folders. When I step through the myfolder.Subfolders collection, they're always in the correct name order, but I suspect that this is not guaranteed. I there any way to be certain that they'll be in order? Can I sort the Subfolders collection, or is my only option to copy the names to an array, then implement an array sort? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Find most recent subfolders "JJ" <jim.mcatee@xxxxxx> wrote in message news:16260050-b01a-4ce7-84ad-ee29b635dd55@xxxxxx Quote: >I have a folder containing some number of subfolders with names > derived from dates, each of them created on that date: > > yyyy-mm-dd > > For example: > > /myfolder/ > ../2009-04-18/ > ../2009-04-25/ > ../2009-05-02/ > ../2009-05-09/ > > I want to find the most recent two folders. When I step through the > myfolder.Subfolders collection, they're always in the correct name > order, but I suspect that this is not guaranteed. I there any way to > be certain that they'll be in order? Can I sort the Subfolders > collection, or is my only option to copy the names to an array, then > implement an array sort? - Read the folders into an array, then sort the array by folder date; - Use the Exec method to invoke the command cmd /c "dir /b /ad /od "c:\My Folder"" then pick up the console output. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| WLM Subfolders? | Live Mail | |||
| Missing subfolders | Vista mail | |||
| recent upgrade XP professionals 32 bit to Vista 64bit cant find dr | Vista networking & sharing | |||
| Sharing all subfolders | Vista networking & sharing | |||
| where did my subfolders go? | Vista mail | |||