For about the millionth time, I was downloading the photos from my digital camera and organizing them into folders by dateβ¦ by hand. I’ve tried a few different tools to do this in the past and have always ended up going back to a manual process for one reason or another. So this time I grew fed up (again) with the inanity of the process and decided I’d use PowerShell to accomplish the task, as it seems made for the job.
Of course I searched first for others who had done this β it’s hardly a problem unique to me. I pretty quickly found someone who not only had gotten it to work but had some pretty nice links to help for those new to PowerShell. Hans of course also linked to the original author, Kim, and his post on organizing photos into folders by EXIF date taken. A couple of other useful links:
- Download and Install PowerShell
- Learn How To Run Scripts (no it doesn’t just work out of the box, but almost)
- If you grab my file and just type OrgPhotos.ps1 into your PS prompt and it doesn’t work, this link will probably tell you why.
Here’s a link to my working script:
The only hitch I ran into was that it’s been so long since I’ve done anything with PowerShell, I forgot what the extension for it was. I thought maybe it was psl not ps1 (and the font used on the original post didn’t distinguish between the two). P-S-ell sounds more like PowerShell than P-S-one but at any rate if you try to run a.psl file from PowerShell, you’ll simply get an error like:
Program ‘foo.psl’ failed to execute: No application is associated with the specified file for this operation.
Easy fix β rename it to foo.ps1. (P-S-one)
Here’s my final version of the script. I also made the paths use YYYY-MM-DD as these sort properly chronologically when windows sorts the folders by filename.
|
|