powershell or other script to make files creation date = modified date

something messed up my mp3 and image library. Now, the files have correct modified data but the creation date is newer!

That for some reason makes using robocopy to backup my library impossible (robocopy thinks files are always changing, even when they did not).

I saw some tools people wrote to let you edit via gui or even cmd line the properties of files, but all expect you to tell them the date you want to set. that will not work since I have files in different dates cross 10 years.

i figured it is a simple powershall script to iterate over folder/sub folder and set each files creation date to be the modified date.

Any poweshall wizard that can show me the way? or at least get me started?

1 Answer

  1. Joe- Reply


    Get-ChildItem -recurse -filter *.mp3 | % { $_.CreationTime = $_.LastWriteTime }

    That should do the job.

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>