Page 1 of 1
Posted: Wed Mar 08, 2006 9:28 pm
by GORDON
Is there any quick way to take a folder full of jpg's with spaces in the names (ex - "death valley.jpg") and rename all the files by replacing the space with, say, an underscore?
Posted: Wed Mar 08, 2006 9:30 pm
by thibodeaux
vbscript, maybe.
Posted: Thu Mar 09, 2006 1:01 am
by Cakedaddy
Do CMD batch files still work?
Use the ren command in one.
Posted: Thu Mar 09, 2006 3:32 am
by Zetleft
Ok googled this little batch file workaround for ya, yeah I'm that bored right now.
Create any batch file, named mine test.bat and put this in it (or course change to the directory name you gonna be using), this is just gonna call another batch file, and I had all the images in the testbatch folder so name that whatever folder your files are gonna be in:
Code: Select all
@echo off
for /r D:\testbatch\ %%K in (*.gif) do call D:\testbatch\rename.bat "%%K"
pause
exit
and create anther batch file that does the renaming, called mine rename.bat as you can tell from the code.
rename.bat
Code: Select all
@ECHO OFF
REM Set the File name without ext to Flenme variable
Set Flenme="%~n1"
REM Set Extn to extension only
Set Extn=%~x1
REM Replace Spaces with underscores
Set Flenme=%Flenme: =_%
ECHO %~nx1 Changed to %Flenme%%Extn%
REM Now Rename the file
REN "%~f1" %Flenme%%Extn%
Worked fine in my winxp computer and it didn't blow up or anything.[/color]
Edited By Zetleft on 1141893232
Posted: Thu Mar 09, 2006 8:30 am
by Paul
I use Lupas Rename for that sort of stuff.
It works great. Lots and lots of options.
Edited By Paul on 1141911045