My dad was a big fan of slides as a film medium back in the day.  I have boxes of these suckers that span at least the last four decades of the Twentieth Century.

A few years ago, I bought one of those slide scanner gizmos and started in on the overwhelming task.  One thing I immediately found frustrating was the timestamp: my scanner would affix a timestamp–June 1, 2013–to every slide.  I examined every nook and cranny of the menu to see where I could set the current time and date and found no way to set it.

To me, having an accurate timestamp on my scanned photos is important–it lets me know, and anyone else with whom I share my files, when I actually did the work.  It can help me group images together that may all be part of the same set.  It might even help me identify unknown individuals in the photos.   So, it’s important to get the date right on the files.

What can I do?  I know: PowerShell can solve this problem!  Here’s a short code snippet I now use to get the dates right on my scanned slides:


1
2
$dir = "C:\my_path\slides"  # set the filepath to my slides
gci $dir | where {$_.Extension.ToLower() -eq ".jpg"} | foreach{$_.CreationTime = (Get-Date); $_.LastWriteTime = (Get-Date)}

This will at least set the image timestamp to the current date and time.  Assuming you scanned the slides on the same day, you should be set.  If you want to set the timestamp to an earlier date, that can easily be done, as well, but I won’t go into it here.  Also know that there are a number of date properties with a file: create date, last modified date, etc.  I’m using a “hammer” approach to this problem by setting both the CreationTime and LastWriteTime properties.

My scanner also has a pre-set naming convention for the slides it scans.  In general, that’s fine with me, but you can also use PowerShell to easily rename your scanned images to your own convention.  Here, I want to indicate that all the slides in a given directory are part of the same group, so I basically add a “_grp001” suffix to the end of each file:


1
2
3
$dir = "C:\data_files\slides2"
$suffix = '_grp001.jpg'
gci $dir | where {$_.Extension.ToLower() -eq ".jpg"} | foreach{mv $_.FullName $_.FullName.ToLower().Replace('.jpg', $suffix)}