How to set Created date to fixed value for all files within a folder tree

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
TechHarmony
Posts: 4
Joined: 06 Jan 2012 04:38
Location: California, USA

How to set Created date to fixed value for all files within a folder tree

Post by TechHarmony »

Is there a way to set the created date to a fixed (user selected) date value for all files within a folder tree structure?
I've looked in the forum but most questions relate to either exif, or setting to current date.

I'm working on a website where some of the files from a product vendor have no date data or else 1/1/1980 in the created data field.
I wish to be able to change that to the date of the version release, so I know better what is what.

I would want thus to be able to set all files and folders within a folder to have the same created date.
I did not see such in the set files special on my Pro installed version (only the exif). And as I say, I don't want to ''nix style touch' them to have today's date, I need to set them all to a date in the past.

Thank you.
the Universe is intelligent and friendly :)

chincherpa
Posts: 37
Joined: 13 Dec 2016 10:58
Location: Stuttgart, Germany

Re: How to set Created date to fixed value for all files within a folder tree

Post by chincherpa »

Hi,

that would be my solution (sets DateCreated of all selected files to "2016-12-06 12:30:00"):

Code: Select all

// Get the current selection.
$sel = Get('SelectedItemsPathNames');

// For each item in the selection...
   foreach($item, $sel, "<crlf>") {
   timestamp 'c', "2016-12-06 12:30:00", $item;
}
"extracted" from here: viewtopic.php?f=7&t=10966

highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: How to set Created date to fixed value for all files within a folder tree

Post by highend »

No need to do this case with a foreach loop (because all files + folders should be set to the same date and no date needs to "extracted" e.g. from a file name)

Code: Select all

timestamp "c", datepicker(), quicksearch(, , "|");
The datepicker() let's you select a date (default = today) and quicksearch delivers the necessary files + folders without the need to select
them first in the current directory. Be careful, It's modifying everything recursively from within the current path and down.
If you don't want this, change it like this:

Code: Select all

timestamp "c", datepicker(), quicksearch("/n", , "|");
One of my scripts helped you out? Please donate via Paypal

Post Reply