Dim fso Dim f Dim f2 Dim fl Dim fc Dim scriptfile Dim scriptpath Dim TobeReplaced Dim ReplaceWith Dim RandomFilename Dim NewFilename Dim sRight Dim sLeft Dim result scriptfile = WScript.ScriptFullName Set fso = WScript.CreateObject("Scripting.FileSystemObject") Set f = fso.GetFile(scriptfile) scriptpath = f.ParentFolder Set fl = fso.GetFolder(scriptpath) Set fc = fl.Files For Each f in fc If f.name <> "rename.vbs" Then RandomFilename=f.name End If Next TobeReplaced=Inputbox("Replace What:","Specify a string to replace",RandomFilename) If (Len(TobeReplaced) > 0) Then ReplaceWith=Inputbox("With What:","Specify a replacement string",TobeReplaced) If (Not IsEmpty(ReplaceWith)) Then For Each f in fc If f.name <> "rename.vbs" Then f.name=Replace(f.name, TobeReplaced, ReplaceWith) End If Next End If Else ReplaceWith=Inputbox("Insert this:","Specify a string to concatinate","") If (Len(ReplaceWith) > 0) Then If (Not IsEmpty(ReplaceWith)) Then For Each f in fc If f.name <> "rename.vbs" Then f.name=ReplaceWith & f.name End If Next End If Else TobeReplaced=Inputbox("Insert location:","Specify left side of string",RandomFilename) If (Len(TobeReplaced) > 0) Then ReplaceWith=Inputbox("Specify a string to insert at char: " & Len(TobeReplaced),"Insert this:") If (Not IsEmpty(ReplaceWith)) Then For Each f in fc If f.name <> "rename.vbs" Then sLeft = Left(f.name, Len(TobeReplaced)) sRight = Right(f.name, Len(f.name) - Len(TobeReplaced)) f.name = sLeft & ReplaceWith & sRight End If Next End If Else TobeReplaced=MsgBox("Fix Underscores?",1,"Fix Underscores?") If (TobeReplaced=1) Then For Each f in fc If f.name <> "rename.vbs" Then result=Replace(f.name, "_", " ") If (f.name<>result) Then f.name=result End If End If Next Else TobeReplaced=MsgBox("Fix Dashes?",1,"Fix Dashes?") If (TobeReplaced=1) Then For Each f in fc If f.name <> "rename.vbs" Then result=Replace(f.name, "-", " - ") If (f.name<>result) Then f.name=result End If End If Next For Each f in fc If f.name <> "rename.vbs" Then result=Replace(f.name, " - ", " - ") If (f.name<>result) Then f.name=result End If End If Next End If End If End If End If End If Set f = Nothing Set f2 = Nothing Set fc = Nothing Set fl = Nothing Set fso = Nothing WScript.Quit