# How to copy "created" datestamp to "modified" of files - but not by hand?

**URL:** https://community.mp3tag.de/t/how-to-copy-created-datestamp-to-modified-of-files-but-not-by-hand/54079
**Category:** Off-Topic
**Created:** [August 15, 2021, 4:24pm UTC](https://community.mp3tag.de/t/how-to-copy-created-datestamp-to-modified-of-files-but-not-by-hand/54079 "2021-08-15T16:24:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [August 15, 2021, 4:24pm UTC](https://community.mp3tag.de/t/how-to-copy-created-datestamp-to-modified-of-files-but-not-by-hand/54079/1 "2021-08-15T16:24:42Z")

</div>

Long story short - in my new configuration of Mp3ag I forgot to select select the box for

**Options \> Tags \> General \> Preserve file modification time when saving files**

And so I need to restore in over 500 files their previous `Modified` "attribute" [as my meticulous naming and tagging system requires it]. I know I can either do it one-by-one by hand using for example BulkFileChanger. i do not mind the hand-by-hand part - but doing it in a totally manual way would mean that I would have to first check the `Modified` dates on them [over 500 times]  
` `  
` `  
So does anyone know a way to automatically copy `Created` over `Modified`? And in a quick / easy way

Some kind of software or BAT / PS1 script that would allow me just to drag and drop selected file and click an option for it or right click it for choosing some entry from its shell menu?

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [August 15, 2021, 6:20pm UTC](https://community.mp3tag.de/t/how-to-copy-created-datestamp-to-modified-of-files-but-not-by-hand/54079/2 "2021-08-15T18:20:37Z")

</div>

Using the file modification time is a really bad practice. I highly suggest you to change your process.

> [@Zerow](#):
>
> So does anyone know a way to automatically copy `Created` over `Modified`? And in a quick / easy way

Yes, in Powershell you get the various attributes and timestamps with:  
`$file = Get-Item C:\temp\YourFileName.mp3`

then you got three timestamps:

```auto
$file.creationtime
$file.lastaccesstime
$file.lastwritetime

```

You can assign the timestamp `.creationtime` to a variable like  
`$MyCreationTime = $file.creationtime`  
and then assign the content of this variable back to your file with  
`$file.lastaccesstime = $MyCreationTime`  
or  
`$file.lastwritetime = $MyCreationTime`

Now you have only to create a Powershell-Script which accept your selected files or do the above for the content of an entire folder or even recursive.

If you want to check the three timestamps, you can use:  
`Get-Item C:\temp\YourFileName.mp3 | select name, *time`  
If you want to check all the six timestamps (inluding the one in UTC), you can use:  
`Get-Item C:\temp\YourFileName.mp3 | select name, *time*`

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [August 16, 2021, 7:48am UTC](https://community.mp3tag.de/t/how-to-copy-created-datestamp-to-modified-of-files-but-not-by-hand/54079/3 "2021-08-16T07:48:49Z")

</div>

If you really want to copy the timestamp `.CreationTime` from your existing files to the timestamp `.LastWriteTime` ("Modified"/"Geändert") then you can use this Powershell one line command:

`Get-ChildItem 'C:\Temp\Folder with files to modify\' *.mp3 -recurse | ForEach-Object{$_.LastWriteTime = $_.CreationTime}`

This would change all your \*.mp3 `.LastWriteTime` timestamps recursively, starting from `C:\Temp\Folder with files to modify\`  
Please test it carefully and create backups of your files before you mass change them.

---

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [August 17, 2021, 4:18pm UTC](https://community.mp3tag.de/t/how-to-copy-created-datestamp-to-modified-of-files-but-not-by-hand/54079/4 "2021-08-17T16:18:24Z")

</div>

Well this works. My localized version would be

> Get-ChildItem 'C:\Users\YOUR-USER-NAME\Documents' \*.flac -recurse | ForEach-Object{$_.LastWriteTime = $_.CreationTime}

But this has a caveat: I cannot copy the affected files to [in this case] `C:\Users\YOUR-USER-NAME\Documents` because this will change their `creation date`. So I would have to work on the very affected files without backup copies [unless I would make an image of the drive]. And also I would have to open the folders with those files [still around 500], then copy this PS1 to every such folder and then run the srcipt it and delete it afterwards. Which adds up to thousands of by-hand operations  
` `  
` `  
And so I tried coming up with an Action. I tried some variations of

> Format value  
> Field: \_FILE\_MOD\_DATETIME\_RAW  
> Format string: %\_file\_create\_datetime\_raw%

but failed at seeing any changes  
` `  
` `  
And then I checked the aforementioned by me **BulkFileChanger**. And there it was tight under my nose- an option for easy coping of data

And so I just sorted all of my files by `%_FILE_MOD_DATE%` in Mp3tag, selected them, drag & dropped them to BulkFileChanger and executed the tested operation. And that was it  
` `  
` `  
So thank you

We have now two working solution to this problem - although I doubt there are many user who would deem various versions of dates of files as an issue at all
