Experts Exchange connects you with the people and services you need so you can get back to work.
Improve company productivity with a Business Account.Sign Up
Dim fso, sfolder, folder, files, tempfilename, newfilename
Set fso = CreateObject("Scripting.FileSystemObject")
sfolder = "C:\Temp"
Set folder = fso.GetFolder(sfolder)
Set files = folder.Files
For each folderIdx In files
tempfilename = Left(folderIdx.Name, Len(folderIdx.Name) - (Len(folderIdx.Name) - (InStrRev(folderIdx.Name, "_"))) - 1)
newfilename = Left(tempfilename, Len(tempfilename) - (Len(tempfilename) - (InStrRev(tempfilename, "_"))) - 1)
fso.MoveFile sfolder & "\" & folderIdx.Name, sfolder & "\" & newfilename & ".pdf"
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.