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. This is what I have so far but keep getting end of statement error
strCommand = "msiexec.exe /i " & chr(34) & strScriptFolder & "Src\Wings-Client_v2015.4.0.msi" WSMCONFIGTYPE="SSL Secure" PROTOCOL="https"  HOSTNAME="Wingsserver.com" & chr(34) & " /QN REBOOT=ReallySuppress /l*v " & chr(34) & "C:\Logs\Appinst\WingsClient_v2015.4.0_MSI_INST.log" & chr(34)

Open in new window



this is what it is supposed to translate to:
msiexec /i "N:\Wings-ClientV7.msi" WSMCONFIGTYPE="SSL Secure" PROTOCOL="https" HOSTNAME="Wingsserver.com" / QN REBOOT=ReallySuppress /l*v "  "C:\Logs\Appinst\WingsClient_v2015.4.0_MSI_INST.log"
NOTE: scriptfolder is a variable to the path
xzay1967Asked:
Who is Participating?
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.

dsackerContract ERP Admin/ConsultantCommented:
Assuming you meant:

N:\Src\Wings-Client_v2015.4.0.msi
and not

N:\Wings-ClientV7.msi
I also assume that strScriptFolder = "N:\"

If so, this should work:
strCommand = "msiexec.exe /i """ & strScriptFolder & "Src\Wings-Client_v2015.4.0.msi"" WSMCONFIGTYPE=""SSL Secure"" PROTOCOL=""https"" HOSTNAME=""Wingsserver.com"" /QN REBOOT=ReallySuppress /l*v "" ""C:\Logs\Appinst\WingsClient_v2015.4.0_MSI_INST.log"""

Open in new window

0
LearnctxEngineerCommented:
You just need to ensure you consider where you are closing your quotes.

strCommand = "msiexec.exe /i " & chr(34) & strScriptFolder & "Src\Wings-Client_v2015.4.0.msi" & chr(34) & " WSMCONFIGTYPE="  & chr(34) & "SSL Secure" & chr(34) & " PROTOCOL=" & chr(34) & "https" & chr(34) & " HOSTNAME=" & chr(34) & "Wingsserver.com" & chr(34) & " /QN REBOOT=ReallySuppress /l*v " & chr(34) & "C:\Logs\Appinst\WingsClient_v2015.4.0_MSI_INST.log" & chr(34)

Open in new window

0

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
Robberbaron (robr)Commented:
i have used a simple function before to help with this

Function qt(rawstr )
     qt = chr(34) & rawstr & chr(34)
End Function

strCommand = "msiexec.exe /i " & qt(strScriptFolder & "Src\Wings-Client_v2015.4.0.msi")  & _
    " WSMCONFIGTYPE="  & qt("SSL Secure") & _
    " PROTOCOL=" & qt("https") & _
    " HOSTNAME=" & qt("Wingsserver.com")  & _
    " /QN REBOOT=ReallySuppress /l*v " & qt("C:\Logs\Appinst\WingsClient_v2015.4.0_MSI_INST.log")

Open in new window


it helps make it readable to me and ensures closing quotes as Learnctx noted.
0
xzay1967Author Commented:
Wow thanks guys.
@Rob, I like that layout, never thought about using a function before, so I will try that, thanks for that suggestion
@Learnctx, I used your suggestion and that worked
@dstacker, I did not try yours, but I will assume it would work, and honestly that is how I did it originally. I am a junior here, and the senior engineer wants to start using  the chr(34) option, so that is why I couldn't use yours.
I tried to be fair with the points spread, so I hope I did not do any injustice to anyone.
0
xzay1967Author Commented:
The system would not let me spread the points the way I wanted to, but I did award the best solution option to Learnctx.
0
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.

Question has a verified solution.

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.