Good morning all,
I have hundreds of pdf files like V-45X-0892-0.pdf, V-45X-0893-0.pdf, etc...
I would like to strip the -0 on end of every filename to look like V-45X-0892.pdf, V-45X-0893.pdf, etc..
Any help would be greatly appreciated.
Below is what I have but not working:
folderspec = "C:\Dave\"
strRename = ""
set fs = CreateObject("Scripting.FileSystemObject")
set f = fs.GetFolder(folderspec)
for each f1 in f.files
Filename = folderspec & f1.name
NewFilename = replace(Filename, "*-0.pdf" "*.pdf", strRename)
fs.MoveFile Filename, NewFilename
next
msgbox "All Done"
Thank you in advance,
David
I have hundreds of pdf files like V-45X-0892-0.pdf, V-45X-0893-0.pdf, etc...
I would like to strip the -0 on end of every filename to look like V-45X-0892.pdf, V-45X-0893.pdf, etc..
Any help would be greatly appreciated.
Below is what I have but not working:
folderspec = "C:\Dave\"
strRename = ""
set fs = CreateObject("Scripting.FileSystemObject")
set f = fs.GetFolder(folderspec)
for each f1 in f.files
Filename = folderspec & f1.name
NewFilename = replace(Filename, "*-0.pdf" "*.pdf", strRename)
fs.MoveFile Filename, NewFilename
next
msgbox "All Done"
Thank you in advance,
David