Here is a powershell script that will create a directory structure based on the dates in the pictures. You have to modify the from and to fields, and set up permissions for powershell correctly. But this should help.
# PowerShell script to name photos for printing
# Nicholas Armstrong, Jan 2010
# Available at nicholasarmstrong.com
# Renames a folder of photos for printing using the capture date as the file name
# Run 'Set-ExecutionPolicy Unrestricted' from an admistrative prompt before running
# the first time from a computer that hasn't been set to run Powershell scripts
# Modified XXXX, 2012
# Define where we are moving from / to
$from = "C:\Users\XXXX\OneDrive\Pictures"
$to = "E:\Pictures"
#make debugging easier
cls
# Load the assemblies needed for reading and parsing EXIF
Write-Output "Loading Assemblies …"
[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") > $null
[System.Reflection.Assembly]::LoadWithPartialName("System.Text") > $null
# Get all the files we want to move
Write-Output "Getting file list …"
$files = Get-ChildItem -include *.jpg -recurse -path $from
# Rename each file
Write-Output "Moving …"
foreach ($file in $files) {
# Get the date for a photo
$year = "0000"
$month = "00"
$day = "00"
if ($file.Extension -eq ".jpg") {
$gotProperty = $FALSE
$photo = [System.Drawing.Image]::FromFile($file.fullname)
try {
$dateProperty = $photo.GetPropertyItem(36867)
$gotProperty = $TRUE
}
catch {
try {
$dateProperty = $photo.GetPropertyItem(306)
$gotProperty = $TRUE
}
catch {
}
}
$photo.Dispose()
if ($gotProperty) {
$encoding = New-Object System.Text.UTF8Encoding
$date = $encoding.GetString($dateProperty.Value).Trim()
$year = $date.Substring(0,4)
$month = $date.Substring(5,2)
$day = $date.Substring(8,2)
}
}
else {
$date = $file.LastWriteTime
$year = $date.year.ToString()
$month = $date.month.ToString()
$day = $date.day.ToString()
if ($month.length -lt 2) {$month = "0" + $month}
if ($day.length -lt 2) {$day = "0" + $day}
}
# Figure out where the file should be
$oldFileName = $file.fullname
$newFilePath = $to + "\" + $year + " pictures\" + $year + $month + "\" + $year + $month + $day
$newFileName = $newFilePath + "\" + $file.name
# Create the directory if needed
if (!(Test-Path -path $newFilePath)) {
New-Item $newFilePath -type directory
}
# Move the file
if (Test-Path -path $newFileName) {
# Write-Host "File exists at " $newFileName " Removing " $oldFileName
# Remove-Item $oldFileName
}
else {
Write-Host "Moved " $oldFileName " to " $newFileName
# Move-Item -path $oldFileName -destination $newFileName
Copy-Item -path $oldFileName -destination $newFileName
}
}
# We are done
Write-Output "Completed."