Rename problem

It seems that VBScript's regexp object doesn't replace all matches if the expression covers the entire string, so only one %20 is being turned into a space.

Change this:

re.Pattern = "(.*)(%20)(.*)" strNewName = re.Replace(strFileName, "$1 $3")

To this:

re.Pattern = "%20" strNewName = re.Replace(strFileName, " ")

You can't use fileinfo in VBScript directly, pass it into the script via as part of strNewName. See here.