file renaming help?

roseilikkalol

New Member
Messages
3
i have a bunch of directories, each one contains exactly 1 jpg file, What I would like to do is to rename all the files cover.jpg, but when I do search on *.jpg and try to rename, it renames every file to cover(1).jpg

Is there a way I can rename the files without tedious folder-by-folder renaming?
 

My Computer

System One

  • OS
    win 8.1
Are the directories all in the same tree? If they all descend from the same folder open a command prompt in that folder. For example if they are all under C:\top open a command prompt in c:\top then enter this command
For /R %s in (*.jpg) do ren %s cover.jpg

and hit enter.

Edit: It should work as long as there is only one .jpg in each folder. (I hope.) :)
 

My Computer

System One

  • OS
    Windows 8.0 x64
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satelite C55D-A Laptop
    CPU
    AMD EI 1200
    Memory
    4 gb DDR3
    Graphics Card(s)
    Raedon 340 MB dedicated Ram
    Monitor(s) Displays
    Built in
    Screen Resolution
    1366 x 768
    Hard Drives
    640 GB (spinner) Sata II
    Keyboard
    Built in
    Mouse
    Touch pad
tried it in test folder (Uusi kansio) where is 2 subfolders, both include 1 jpg file:

C:\Uusi kansio>For /R %s in (*.jpg) do ren %s cover.jpg

C:\Uusi kansio>ren C:\Uusi kansio\asfdafa\00_dance_with_the_dead_-_into_the_abys
s-web-2014-cover-cruelty.jpg cover.jpg
The syntax of the command is incorrect.


C:\Uusi kansio>ren C:\Uusi kansio\dsfg\00_dance_with_the_dead_-_out_of_body-web-
2013-cover-cruelty.jpg cover.jpg
The syntax of the command is incorrect.
 
Last edited:

My Computer

System One

  • OS
    win 8.1
That's because there is a space in the path most likely.

Try this
For /R %s in (*.jpg) do ren "%s" cover.jpg

or just eliminate the spaces. Spaces in file paths is just asking for trouble. Thousands of errors are caused just because the default exe install folder is Program Files. It always comes back to bite. :)
 

My Computer

System One

  • OS
    Windows 8.0 x64
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satelite C55D-A Laptop
    CPU
    AMD EI 1200
    Memory
    4 gb DDR3
    Graphics Card(s)
    Raedon 340 MB dedicated Ram
    Monitor(s) Displays
    Built in
    Screen Resolution
    1366 x 768
    Hard Drives
    640 GB (spinner) Sata II
    Keyboard
    Built in
    Mouse
    Touch pad
Glad it worked for you. :)
 

My Computer

System One

  • OS
    Windows 8.0 x64
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satelite C55D-A Laptop
    CPU
    AMD EI 1200
    Memory
    4 gb DDR3
    Graphics Card(s)
    Raedon 340 MB dedicated Ram
    Monitor(s) Displays
    Built in
    Screen Resolution
    1366 x 768
    Hard Drives
    640 GB (spinner) Sata II
    Keyboard
    Built in
    Mouse
    Touch pad
Back
Top