Ducati Sporting Club UK
Idle Chat
Still needs to be clean and of value to the club.
 
 
Thread Tools Display Modes
Prev   Next
Old 09-Nov-2006, 14:50   #7
DSC Member MJS MJS is offline
DSC Membership Sec. & BHCN R.O.
Webteam
Big Twin
Bikes: None at the moment
MJS's Avatar
 
Posts: 1,948
Join Date: Jul 2003
Location: Pitstone
Mood: Feeling old...
Quote:
Originally Posted by antonye
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

Cheers for that.... as Phil says, I'll try it on something simple first.....!

Martin
Reply
  
Thread Tools
Display Modes
Postbit Selector
Switch to Vertical postbit Use Vertical Postbit

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Recent Posts - Contact Us - DSC Home - Archive - Top
Powered by vBulletin 3.5.4 - Copyright © 2000 - 2025, Jelsoft Enterprises Ltd. - © Ducati Sporting Club UK - All times are GMT +1. The time now is 19:11.