file name space remover?

D

DW

Hi,
Does anyone know of a small program for bulk removing of the spaces in
..jpg file names? This is to avoid the %20 appearing! I just want a
very simple prog that will do this one action only (if possible) as
the other larger renaming progs are just too complicated! many thanks
dee
 
S

Steven Burn

Open Notepad and paste the following, then save it as "renjpg.vbs" (with the quotes).

'// RenJpg.vbs
Dim objFSO, objFldr, objFl, sFolderPath, sOriginal, sNew, iCount
Set objFSO = CreateObject("Scripting.FileSystemObject")

'// Change the path below to the path containing your images
sFolderPath = "C:\Temp\My_Images"

Set objFldr = objFSO.GetFolder(sFolderPath): iCount = 0
For Each objFl In objFldr.Files
If Right(Lcase(objFl.Name), 4) = ".jpg" Then
sOriginal = objFl.Path
sNew = objFldr.Path & "\" & Replace(objFl.Name, " ", "_")
If Instr(1, sNew, "//") > 0 Then sNew = Replace(sNew, "//", "/")
objFSO.MoveFile sOriginal, sNew
iCount = iCount + 1
End If
Next
Set objFSO = Nothing
MsgBox iCount & " files renamed"

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
D

DW

Open Notepad and paste the following, then save it as "renjpg.vbs" (with the quotes).

'// RenJpg.vbs
Dim objFSO, objFldr, objFl, sFolderPath, sOriginal, sNew, iCount
Set objFSO = CreateObject("Scripting.FileSystemObject")

'// Change the path below to the path containing your images
sFolderPath = "C:\Temp\My_Images"

Set objFldr = objFSO.GetFolder(sFolderPath): iCount = 0
For Each objFl In objFldr.Files
If Right(Lcase(objFl.Name), 4) = ".jpg" Then
sOriginal = objFl.Path
sNew = objFldr.Path & "\" & Replace(objFl.Name, " ", "_")
If Instr(1, sNew, "//") > 0 Then sNew = Replace(sNew, "//", "/")
objFSO.MoveFile sOriginal, sNew
iCount = iCount + 1
End If
Next
Set objFSO = Nothing
MsgBox iCount & " files renamed"

Thanks, have managed to make this .vbs file with above but if I click
on this will it put something permanently in the registry and what way
will it work? Will it just automatically remove spaces from every
single .jpg on my PC? + any future ones added on later??
Ta
dee
 
S

Steven Burn

DW said:
Thanks, have managed to make this .vbs file with above but if I click
on this will it put something permanently in the registry
</snip>

No. It does not touch the registry

and what way will it work?
</snip>

It processes all of the files in the folder and renames the .jpg files

Will it just automatically remove spaces from every
single .jpg on my PC?

No, only the ones in the folder specified in the script (you'll need to change this to suit the folder containing the files you want renamed)
+ any future ones added on later??

If you click on the file again, or automate it with a program such as Log Monitor (http://freeware.it-mate.co.uk/?Cat=System#140), yes

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
M

Morten L.Pedersen

DW said:
Hi,
Does anyone know of a small program for bulk removing of the spaces in
.jpg file names? This is to avoid the %20 appearing! I just want a
very simple prog that will do this one action only (if possible) as
the other larger renaming progs are just too complicated! many thanks
dee

Just google for "file renamer" - there are lots of good filerenaming tools
out there - and they can do a lot more than just removing internal spaces.

regards
 
D

DW

</snip>

No. It does not touch the registry
----snipped------

When I clicked on that .vbs file after putting it in a folder with
..jpgs that I wanted to change I just get box showing >

Line 8
Char 1
Error: Path not found
Code: 800A004C
Source: Microsot VBScript runtime error

D
 
D

DW

Just google for "file renamer" - there are lots of good filerenaming tools
out there - and they can do a lot more than just removing internal spaces.

regards
thanks
i had downloaded a couple of renamers earlier but too confusing, did a
google search again and have just used this one >
http://www.1-4a.com/rename/ You just put the wee .exe file inside
the folder of .jpgs open it up, click for advanced mode and get it to
replace all the spaces with a dash which is probably better than
removing all the spaces comletely. Something simple that woks at last!
Dee
 
S

Steven Burn

Open the VBS file in Notepad and look at the line's containing;

'// Change the path below to the path containing your images
sFolderPath = "C:\Temp\My_Images"

Change C:\Temp\My_Images to the path of the folder containing your files.

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
S

Steven Burn

DW said:
When I clicked on that .vbs file after putting it in a folder with
.jpgs that I wanted to change I just get box showing >
</snip>

Open the VBS file in Notepad and look at the line's containing;

'// Change the path below to the path containing your images
sFolderPath = "C:\Temp\My_Images"

Change C:\Temp\My_Images to the path of the folder containing your files.

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
D

Donald Lessau

DW said:
Hi,
Does anyone know of a small program for bulk removing of the spaces in
.jpg file names? This is to avoid the %20 appearing! I just want a
very simple prog ...

If you can handle Explorer then you can handle TrackerV3 because the
interface is almost identical. In TrackerV3, when you right-click selected
files you find a one-click-space-remover under "Rename Special".

-> http://www.trackerv3.com/

Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top