Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help combing script

Status
Not open for further replies.

dport1968

Technical User
Oct 9, 2019
4
US
Good afternoon all,

I plot pdf's from Autocad and depending if it's from model space or layout I get an output with Model (1) or Layout (1). Currently I am using following script to take care of stripping Model (1) from filename

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, " Model (1)", strRename)
fs.MoveFile Filename, NewFilename
next

msgbox "All Done"

How can I combine above script to take care of Layout (1) if included in my directory? I would like it to strip Model (1) and Layout (1) if I have that part of filename in my directory. Any help would be greatly appreciated.

Thank you,

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top