View Single Post
Old 09-Nov-2006, 14:34   #5
DSC Member antonye antonye is online now
Administrator
Webteam
MotoGP God
Bikes: 748S, HM1100S, V4SP, Was: DD-A #111
antonye's Avatar
 
Posts: 13,088
Join Date: Feb 2002
Location: Back in Essex
Mood: Passion Killer
Save this as "rename.vbs" in the target directory.

Edit it so that the sPath is the name of the folder, and the sExt
is the name of the extension you wish to check (to filter for
just .gif files, for example).


Double click it in Windows Explorer and it should do the trick.


-- 8< -- cut here -- 8< --


sPath = "c:\temp\folder\"
sExt = ".gif"


Set fsoObject = CreateObject("Scripting.FileSystemObject")
Set fsoFolder = fsoObject.GetFolder(sPath)
for each fsoFile in fsoFolder.Files
if (Right(fsoFile.Name, Len(sExt)) = sExt) then
sNewName = Replace(fsoFile.Name, ".", "_rev1.")
fsoFile.Name = LCase(sNewName)
end if
next
Set fsoFolder = Nothing
Set fsoObject = Nothing


I'd rather die peacefully in my sleep like my Grandfather,
than screaming in terror like his passengers.- Jim Harkins

Ducati 748S | Ducati Hypermotard 1100S | Ducati Panigale V4 SP #876 | 600-620SS DesmoDue Racebike #111 <-- Sold!!

Last edited by antonye : 09-Nov-2006 at 14:37.
Reply