1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Any good mass file rename scripts outthere?

Discussion in 'General Scripting Chat' started by M1ndfluX, Aug 27, 2012.

  1. M1ndfluX

    M1ndfluX Senior Member

    Joined:
    Dec 23, 2009
    Messages:
    1,119
    Likes Received:
    868
    Location:
    031010
    Hey all!

    When i mass download google images its always a too much time consuming issue to rename all the gfx into keyword1.jpg/keyword2.jpg/keyword3.jpg etc etc...

    So like the title stated, i need a mass file renamer so i can entirely rename all file names in a specific directory.


    Any ideas guys?

    Very appreciated.
     
  2. M1ndfluX

    M1ndfluX Senior Member

    Joined:
    Dec 23, 2009
    Messages:
    1,119
    Likes Received:
    868
    Location:
    031010
    Hi MAD,


    Thanks for the reply bro.

    Not sure on how to use this code. Can you tell me on how to execute this?


    Regards
     
  3. M1ndfluX

    M1ndfluX Senior Member

    Joined:
    Dec 23, 2009
    Messages:
    1,119
    Likes Received:
    868
    Location:
    031010
    Nope, windows right here man ;) Servers on linux though.
     
  4. qrazy

    qrazy Senior Member

    Joined:
    Mar 19, 2012
    Messages:
    1,113
    Likes Received:
    1,712
    Location:
    Banana Republic
    Code:
    @echo off
    set i=1
    for %%f in ([COLOR=#000080]c:\test\[/COLOR]*) do call :renameit "%%f"
    goto done
    
    :renameit
    ren %1 "[COLOR=#0000cd]keyword__[/COLOR]%i%"
    set /A i+=1
    
    :done
    

    Copy the above code in a .bat file, change the highlighted part to your local directory and keyword. Start the command prompt and run it. Don't copy this bat file in the same directory where the images are kept. It's better to create new directory and copy only the image files to it and run this script. let me know if this works