Script to Update "Created/Modified Date" Based on File Name

Discuss and share scripts and script files...
highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Script to Update "Created/Modified Date" Based on File N

Post by highend »

Change this line:
$date = regexreplace($file, $RegExFind, $RegExReplace);
to:
$date = regexreplace(getpathcomponent($file, "base"), $RegExFind, $RegExReplace);
and try it again.
One of my scripts helped you out? Please donate via Paypal

Sloot
Posts: 3
Joined: 20 Jan 2013 04:28

Re: Script to Update "Created/Modified Date" Based on File N

Post by Sloot »

This worked perfectly! Thanks very much.

I have spent a lot time looking for a way to change the modified / created date of my video files based on the file name. I came across XYplorer yesterday and a possible solution to my problem with XYplorer's powerful scripting capabilities.

Great product and great support from this community.

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Script to Update "Created/Modified Date" Based on File N

Post by serendipity »

Sloot wrote:Great product and great support from this community.
Welcome!
Glad you found a solution.
Tip: If you think XYplorer is something you will use for a long time then invest in a lifetime license which is available ONLY until 27th of this month. Lifetime license will be obsolete on 28th January.
Statement by Admin: http://www.xyplorer.com/xyfc/viewtopic. ... 070#p80070
Link to license page: http://www.xyplorer.com/purchase.php

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

Re: Script to Update "Created/Modified Date" Based on File N

Post by highend »

This worked perfectly! Thanks very much
np.
One of my scripts helped you out? Please donate via Paypal

Post Reply