Rename files to creation date recursively with Power Shell

One problem I have managing the record files of my security cameras is that they are saved in this way:

– YH1080P_Record
– 2021Y10M26D06H
– 2021Y10M26D07H
-23M00S.mp4   …

Like in this pic:

So, there are a lot of files with the same name, in different folders. I want to keep all files of a range of days in one unique folder, but I can’t because the have the same name. What if I could rename that files to get they had a unique name? What name? Its creation date. I will do it with this Power Shell command:

Get-ChildItem *.mp4 -Recurse | Rename-Item -newname {$_.LastWriteTime.toString(“”) + “.mp4”}

Now I am able to move all this files to a unique folder, and make it easier to generate a video with Premiere, for instance.

This pic shows the result, every file has it own date creation as filename:



Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *