Hello,
The file name I want to use is always different, though the directory path name is the same. How can I get the variable to see the same directory path without throwing in the extra quotes? For example, I enter DE000000 for the drawing number.
ScriptFileName = Drawing_Number & ".scr"
When I have this format for the path and file name:
ScriptPathandFile = """S:\DsnTools\Drawing Search Tool\UNIT ARRAY\"" " & ScriptFileName
I get this:
ScriptPathandFile now equals ""S:\DsnTools\Drawing Search Tool\UNIT ARRAY\" DE000000.scr"
Notice the space and quote just before the scr file name.

When I use this format:
ScriptPathandFile = """S:\DsnTools\Drawing Search Tool\UNIT ARRAY\" & ScriptFileName & ""

I get:
ScriptPathandFile now equals ""S:\DsnTools\Drawing Search Tool\UNIT ARRAY\DE000000.scr"

In both cases I get an extra quote at the beginning.

Thanks in advance for your help.
Mark

Ok, never mind. I got it worked out.
PathName = "S:\DsnTools\Drawing Search Tool\UNIT ARRAY\"
AcadPath = """C:\Program Files\AutoCAD 2008\acad.exe"""
ScriptFileName = Drawing_Number & ".scr"

ScriptPathandFile = PathName & ScriptFileName


LaunchAcadWithScript = AcadPath & " /b """ & ScriptPathandFile & """"
Shell LaunchAcadWithScript

Don't know if that's the best way, but it worked for me.

Mark

Why are you using extra quotes?

ScriptPathandFile = "S:\DsnTools\Drawing Search Tool\UNIT ARRAY\" & ScriptFileName

should do just fine

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.