Help with quotes in script

Hey all I am trying to build a package using a VB script. I am having some trouble applying the quotes so that the install script gets interpreted correctly. I am not getting an error, but when I echo the output, it is not translated to what it is supposed to be.
Here is what I have so far
strScriptFolder & "Source\setup.exe" & " /Config" & " \\Hplandesk95\packages\Microsoft\Publisher 2010\Source\AddPublisher.xml" & Chr(34) &  " /Modify Proplus"

Open in new window

This is what it is supposed to translate to:
"\\Hplandesk95\packages\Microsoft\Office2010\x32\Source\Setup.exe" /config "\\Hplandesk95\packages$\Microsoft\Publisher 2010\Source\AddPublisher.xml" /modify ProPlus

Open in new window

strScriptFolder is the variable for: \\Hplandesk95\packages\Microsoft\Office2010\x32
Thanks in advance
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


wscript.echo """" & strScriptFolder & "Source\setup.exe""" & " /Config" & " ""\\Hplandesk95\packages\Microsoft\Publisher 2010\Source\AddPublisher.xml""" &  " /Modify Proplus"

Open in new window

xzay1967Author Commented:
Lol, thanks Chris, I see you totally removed the chr(34). For me that is fine, it is just that my senior wants to stick that format. I will still try it and see if it works. Thanks again.
Bill PrewIT / Software Engineering ConsultantCommented:
I prefer to use a small function for the adding of double quotes in cases like this, easier to read and maintain I think.  Give this approach a try:
Quote(strScriptFolder & "Source\setup.exe") & " /Config " & Quote("\\Hplandesk95\packages\Microsoft\Publisher 2010\Source\AddPublisher.xml") & " /Modify Proplus"

' Add surrounding double quotes to a string
Function Quote(s)
   Quote = Chr(34) & s & Chr(34)
End Function

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.