+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, Renaming Files Across Different Folders in Coding and Web Development; Over the years, I have amassed several 1000s of photos that I have backed up from my iPhone. If memory ...
  1. #1
    Zoom7000's Avatar
    Join Date
    Feb 2006
    Location
    London
    Posts
    927
    Thank Post
    303
    Thanked 79 Times in 52 Posts
    Rep Power
    32

    Renaming Files Across Different Folders

    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
    \2014

    I'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.

  2. #2
    clareq's Avatar
    Join Date
    Dec 2005
    Location
    Doncaster
    Posts
    693
    Thank Post
    52
    Thanked 188 Times in 124 Posts
    Rep Power
    101
    Look at pfrank - it's very good, free file renaming software, which will allow you to create a regex script to drive the rename.

  3. #3


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,778
    Thank Post
    223
    Thanked 2,633 Times in 1,940 Posts
    Rep Power
    780
    Just an idea, but what about renaming the photos with the date/time from the embedded EXIF data using EXIFTool? e.g.

    Code:
    @ECHO OFF
    SETLOCAL ENABLEDELAYEDEXPANSION
    SET SCRIPTDIR=%~dp0
    SET SCRIPTDIR=%SCRIPTDIR:~0,-1%
    
    FOR %%i IN (*.jpg) DO "%SCRIPTDIR%\EXIFTOOL" -d "%%Y-%%m-%%d_%%H-%%M-%%S.jpg" "-FileName<DateTimeOriginal" "%%i"

  4. Thanks to Arthur from:

    Zoom7000 (24th June 2014)

  5. #4
    Zoom7000's Avatar
    Join Date
    Feb 2006
    Location
    London
    Posts
    927
    Thank Post
    303
    Thanked 79 Times in 52 Posts
    Rep Power
    32
    Quote Originally Posted by Arthur View Post
    Just an idea, but what about renaming the photos with the date/time from the embedded EXIF data using EXIFTool? e.g.

    Code:
    @ECHO OFF
    SETLOCAL ENABLEDELAYEDEXPANSION
    SET SCRIPTDIR=%~dp0
    SET SCRIPTDIR=%SCRIPTDIR:~0,-1%
    
    FOR %%i IN (*.jpg) DO "%SCRIPTDIR%\EXIFTOOL" -d "%%Y-%%m-%%d_%%H-%%M-%%S.jpg" "-FileName<DateTimeOriginal" "%%i"
    Thanks @Arthur. That worked perfectly!

SHARE:
+ Post New Thread

Similar Threads

  1. Comparing ini files across multiple folders.
    By kennysarmy in forum Windows
    Replies: 3
    Last Post: 18th December 2012, 11:58 AM
  2. Staff seeing different versions of file from shared folder
    By sadams1980 in forum Windows Server 2000/2003
    Replies: 6
    Last Post: 27th November 2012, 12:29 PM
  3. Replies: 1
    Last Post: 13th October 2010, 10:46 AM
  4. Copy file across variable folder name
    By SimpleSi in forum *nix
    Replies: 11
    Last Post: 10th March 2009, 06:15 PM
  5. Can't rename files/folder
    By adamf in forum Windows
    Replies: 5
    Last Post: 30th January 2009, 11:32 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •