Change the modified date of a folder to match oldest file

Post any Bulk Rename Command support requirements here. Open to all registered users.

Change the modified date of a folder to match oldest file

Postby chienpourri » Tue Sep 10, 2013 6:42 pm

Ok there is something I need to do, and I can only hope that BRU can do it for me.

Here's what I would like to do for each and every sub-folder in my structure:

-Go in the first folder
-Scan the files and find the oldest one
-Change the creation date of the folder to match the file's creation date
-Go to the next folder and repeat

***CONTEXT for those who are interested***

Over the last 12 years I have taken lots and lots of picture with my digital cameras. What I've been doing all this time was unload my pictures to a folder, name that folder to something significant and put it all in a flat structure in my "Photos" folder. As this "Photos" folder grew, it was moved from drive to drive, and now is in a bigger structure replicated on 3 NAS shares and backup-up on Blu-Ray's.

The problem is that over time as I copied the file structure the folder creation dates changed from when they were originally created to when they were copied. Therefore all my "older" folders have the same date, from they day I copied them over. Right now if I use Picasa I don't have to worry about that because the files are automatically sorted by the photo creation date, no matter what is the folder's creation date they're in. However, using XBMC for instance, I can't order the picture chronologically because it uses the folder creation date to sort.

The final goal of this operation is to be able to sort all the folders by creation date, that way I would have my folders in the order the photos were taken, all that without changing the files or folders names.
Last edited by chienpourri on Wed Sep 18, 2013 3:36 pm, edited 1 time in total.
chienpourri
 
Posts: 2
Joined: Tue Sep 10, 2013 4:05 pm

Change Folder date to date of oldest File

Postby Stefan » Wed Sep 11, 2013 7:15 am

All we need from your long novel is this part:

chienpourri wrote:Here's what I would like to do for each and every sub-folder in my structure:

-Go in the first folder
-Scan the files and find the oldest one
-Change the creation date of the folder to match the file's creation date
-Go to the next folder and repeat


For that use a scripting language like VisualBasicScript, JavaScript, PowerShell or Python. THIS is a renaming tool.


And... think about a better Subject line for your next threat.
Your "How would I do the following thing?" is meaningless for all others who are on the search for there problem.





Please wait a few seconds then submit. Thank you.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: How would I do the following thing?

Postby chienpourri » Wed Sep 18, 2013 3:35 pm

Whoa such hostility! That was totally uncalled for.... I guess it's a very good thing that I can't use your product for what I want to achieve. Instead of simply stating the desired effect I prefer giving context as to why I need this, sometimes others might have the same problem and my solution could work for them as well.

If anybody else is looking for the same solution, I ended up creating a PowerShell script that does exactly what I wanted.
chienpourri
 
Posts: 2
Joined: Tue Sep 10, 2013 4:05 pm

Re: Change the modified date of a folder to match oldest file

Postby BlueMM » Thu Apr 09, 2015 2:56 am

Hi chienpourri,
I too would like the same utility (it would be great id BRU/BRC did it), any chance you could share your PowerShell script?
Cheers, BlueMM
BlueMM
 
Posts: 2
Joined: Thu Apr 09, 2015 2:49 am


Return to BRC Support