Recently I began backing up photos from 15+ year old CD and DVDs to an external hard drive. One problem I came across was the created date changed to the date I copied the file, but the modified date stayed in tact. This is important for me because of the way I name and archive my photos. I use a program titled NAMEXIF to change most of my photo names, but it would not work because a lot of my old photos do not have EXIF data so I had to find a different solution. In doing some research I found out that you can accomplish the name change of photos/files from powershell.
First I had to create a directory to place the files I wanted to change. I copied over the pictures from the original directory into a Testing directory named C:\Test. This is not necessary, if you are confident in the script, but I wanted to ensure I didn't mess up anything the first time since I haven't used Powershell much.
1. Copy files into the Test directory.
In Powershell
2. Use the following code to get to the correct directory so you can run the script below: cd C:\Test
3. Run the following Powershell script:
Get-ChildItem *.jpg | Rename-Item -newname {$_.LastWriteTime.toString("yyyy-MM-dd-HH-mm-ss") + ".jpg"}
No comments:
Post a Comment