/build/static/layout/Breadcrumb_cap_w.png

Passing a variable to an msi.InstallProducts

New to VBScipt (Old in Winbatch...) In our environment, we need to run installs from long path names with spaces. How do I pass the sCommandPath variable to the ??? below. I tried everything I could think of with combinations of parens, quotes, none, some, etc. I'm sure it's something simple I'm missing here. It works fine if I eliminate the space in the path statement and actual dir, then don't need to nbsp code, but those spaces are going to stay, so...need to get around them. Thanks for any assistance

Dim nbsp, sCommandPath, sPath
sPath="\\dwdsetup\prod\Apps\Lexis-Nexis\Lexis7215\Automated Install\LexisNexis.msi"
nbsp = Chr(160)
sCommandPath = replace(sPath, " ", nbsp)
Set msi = CreateObject("WindowsInstaller.Installer")
msi.UILevel = 4
msi.InstallProducts ???

0 Comments   [ + ] Show comments

Answers (4)

Posted by: WiseUser 18 years ago
Fourth Degree Brown Belt
0
Didn't you mean "msi.InstallProduct" (singular)?
Posted by: fosteky 18 years ago
Purple Belt
0
Maybe a %20 instead of a backspace?:
sPath="\\dwdsetup\prod\Apps\Lexis-Nexis\Lexis7215\Automated%20Install\LexisNexis.msi"
Posted by: brenthunter2005 18 years ago
Fifth Degree Brown Belt
0
sPath=CHR(34) & "\\dwdsetup\prod\Apps\Lexis-Nexis\Lexis7215\Automated Install\LexisNexis.msi" & CHR(34)



CHR(34) is equal to a quotation mark. Another way would be to duplicate the quotation marks as in: sPath="""\\dwdsetup\prod\Apps\Lexis-Nexis\Lexis7215\Automated Install\LexisNexis.msi"""
Posted by: Thegunner 18 years ago
Second Degree Green Belt
0
ORIGINAL: fosteky

Maybe a %20 instead of a backspace?:
sPath="\\dwdsetup\prod\Apps\Lexis-Nexis\Lexis7215\Automated%20Install\LexisNexis.msi"


I would give this one a try, as i have found %20 helps me out a lot.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ