Zoom7000 Posted June 9, 2014 Share Posted June 9, 2014 Over the years, I have amassed several 1000s of photos that I have backed up from my iPhone. If memory serves me correctly iOS names them IMG_0001.jpg, IMG_0002.jpg, IMG_0003.jpg etc etc. Now, whenever I have updated my iOS I have always started afresh without restoring from backup. So, I would manually copy my photos over to my PC. This would mean that iOS would name my pictures starting from IMG_0001.jpg again. I have several 1000s of photos in folders across a folder struct like below:C:\Other Files\Photos...\2010\2011\2012\2013\2014I'd like to get these images all in to one folder "C:\Other Files\Photos"Would it be possible to do a script that would take the photos in folder 2010 and assuming there were 567 photos in that folder rename them to "0001.jpg", "0002.jpg" ... "0567.jpg" and then move on to 2011 and start from "0568.jpg" and so on for the whole folder structure? This is so that I can have all my photos in one folder, without fear of overwriting duplicates and so that I can copy them back to my iPhone Camera Roll and have them in dated order, with the newly taken photos starting at the end of the camera roll after the older ones. Link to comment Share on other sites More sharing options...
Jason S. Global Moderator Posted June 9, 2014 Global Moderator Share Posted June 9, 2014 im sure this is possible, but im no programmer. more pressing, though, is wouldnt you want to keep them in a year format instead of just a number? dont you want to remember when that particular photo was taken? are these just random photos? i like to organize mine into a particular event like 'someone's wedding' or 'whatever vacation'. Link to comment Share on other sites More sharing options...
Zoom7000 Posted June 9, 2014 Author Share Posted June 9, 2014 im sure this is possible, but im no programmer. more pressing, though, is wouldnt you want to keep them in a year format instead of just a number? dont you want to remember when that particular photo was taken? are these just random photos? i like to organize mine into a particular event like 'someone's wedding' or 'whatever vacation'. They're just random photos I've taken on a day to day basis. Nothing is organised in an event. The reason I want to rename the files is because I want them all in my camera roll. Just one big camera roll. Link to comment Share on other sites More sharing options...
Top Qat Posted June 9, 2014 Share Posted June 9, 2014 Time to exercise my AutoIT skills. Link to comment Share on other sites More sharing options...
EZRecovery Posted June 9, 2014 Share Posted June 9, 2014 Perhaps Rename Master would do the job for you! A+Freeware.com - different apps to chose from. Link to comment Share on other sites More sharing options...
sc302 Veteran Posted June 9, 2014 Veteran Share Posted June 9, 2014 http://www.howtogeek.com/111859/how-to-batch-rename-files-in-windows-4-ways-to-rename-multiple-files/ Link to comment Share on other sites More sharing options...
Jeff Peters Posted June 9, 2014 Share Posted June 9, 2014 You could do this in powershell: $count = [int]0;dir -recurse C:\Other Files\Photos *.jpg | foreach-object {Copy-Item -Path $_.FullName -Destination "c:\temp\$($count.ToString() + '.jpg')"; $count++} +LogicalApex and zhangm 2 Share Link to comment Share on other sites More sharing options...
episode Posted June 9, 2014 Share Posted June 9, 2014 They're just random photos I've taken on a day to day basis. Nothing is organised in an event. The reason I want to rename the files is because I want them all in my camera roll. Just one big camera roll. Right, but wouldn't you want say '2011_0001.jpg' instead of just '0001.jpg'? FiB3R 1 Share Link to comment Share on other sites More sharing options...
Zoom7000 Posted June 10, 2014 Author Share Posted June 10, 2014 Right, but wouldn't you want say '2011_0001.jpg' instead of just '0001.jpg'? That sounds like a good idea. You could do this in powershell: $count = [int]0;dir -recurse C:\Other Files\Photos *.jpg | foreach-object {Copy-Item -Path $_.FullName -Destination "c:\temp\$($count.ToString() + '.jpg')"; $count++} Thanks, I'll give that a try and see how it goes! Bit of a n00b question. But how do I run a PS script in a batch file? I know with batch scripts it's .bat and double click, but how do I do that with PowerShell? Link to comment Share on other sites More sharing options...
Eric Veteran Posted June 10, 2014 Veteran Share Posted June 10, 2014 That sounds like a good idea. Thanks, I'll give that a try and see how it goes! Bit of a n00b question. But how do I run a PS script in a batch file? I know with batch scripts it's .bat and double click, but how do I do that with PowerShell? Use ".ps1" for the file extension. Zoom7000 1 Share Link to comment Share on other sites More sharing options...
Top Qat Posted June 10, 2014 Share Posted June 10, 2014 The PowerShell solution looks pretty good, I will abandon my AutoIT efforts. PowerShell looks very interesting. I really must learn about it. You know of any decent online tutorials/reference I can use? Thanks. Link to comment Share on other sites More sharing options...
zhangm Supervisor Posted June 10, 2014 Supervisor Share Posted June 10, 2014 The PowerShell solution looks pretty good, I will abandon my AutoIT efforts. PowerShell looks very interesting. I really must learn about it. You know of any decent online tutorials/reference I can use? Thanks. Whenever I write a shell script, I'm usually always trying to do something specific rather than just learn for the sake of learning, and I've found that web searches are generally very helpful with examples. It's not uncommon that results from this blog pop up: http://blogs.technet.com/b/heyscriptingguy/ Also, Powershell itself includes a pretty comprehensive manual (type get-help <COMMAND> or use the man alias). Link to comment Share on other sites More sharing options...
Zoom7000 Posted June 11, 2014 Author Share Posted June 11, 2014 I tried running the PowerShell command and I got this error: Get-ChildItem : A positional parameter cannot be found that accepts argument '*.jpg'. At line:1 char:20 + $count = [int]0;dir <<<< -recurse C:\Other Files\Photos *.jpg | foreach-object {Copy-Item -Path $_.FullName -Destination "c:\temp\$($count.ToString() + '.jpg')"; $count++} + CategoryInfo : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand Any ideas? EDIT: Found the problem. It was caused by missing quotes around "C:\Other Files\Photos" That script copied the photos to C:\Temp, but it renamed the files "1.jpg", "2.jpg", "3.jpg" etc. Is there anyway I can get the numbering to "0001.jpg", "0002.jpg", "0003.jpg" etc. Link to comment Share on other sites More sharing options...
spikey_richie Posted June 11, 2014 Share Posted June 11, 2014 You've probably sorted this by now, but some time ago there was a tool listed on here https://twitter.com/sourceforge which I used very successfully. Problem is, I can't remember the name of it now :( This might be useful too http://sourceforge.net/directory/system/storage/file-management/os:windows/freshness:recently-updated/ Link to comment Share on other sites More sharing options...
zhangm Supervisor Posted June 11, 2014 Supervisor Share Posted June 11, 2014 That script copied the photos to C:\Temp, but it renamed the files "1.jpg", "2.jpg", "3.jpg" etc. Is there anyway I can get the numbering to "0001.jpg", "0002.jpg", "0003.jpg" etc. $count = [int]0;dir -recurse C:\src\tmp *.jpg | foreach-object {Copy-Item -Path $_.FullName -Destination "c:\src\out\$($count.ToString().PadLeft(4, '0') + '.jpg')"; $count++} Link to comment Share on other sites More sharing options...
spikey_richie Posted June 18, 2014 Share Posted June 18, 2014 Found the tool I was looking for the other day... http://www.dropitproject.com/ Link to comment Share on other sites More sharing options...
Recommended Posts