/build/static/layout/Breadcrumb_cap_w.png

Calling asp_regiis from VBscript in MSI

I have a VBscript to call the aspnet_regiis utility that is part of the dot net framework to encrypt an xml file. This command runs fine when called at a cmd prompt or batch file but is failing without error when run from a vbscript in an msi. Is there a special way I need to call this command in a VBscript to use within an MSI?


StrMessage = "Current install variable: EncryptionCmd ->" & StrDotNetBinFolder &"aspnet_regiis -pef ""connectionStrings"" """&StrInstallFolder&""""
WriteLog LogFilePath, StrMessage
'Encrypt connection strings: wait for it to complete before moving onto next step
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("cmd /c"&StrDotNetBinFolder &"aspnet_regiis -pef ""connectionStrings"" """&StrInstallFolder&"""")

0 Comments   [ + ] Show comments

Answers (2)

Posted by: anonymous_9363 15 years ago
Red Belt
0
- Does the script execute OK outside of the MSI?
- Why bother calling CMD.EXE? Just call the EXE directly.
- Does 'StrDotNetBinFolder' have a trailing backslash? If not, add one. Or better yet, add code to make sure there is one.

Also, you'll find your code easier to read if you enclose only actual strings in quotes and use Chr(34) instead where lines require quotes.
Posted by: captain_planet 15 years ago
Black Belt
0
Set oExec = WshShell.Exec("cmd /c " & StrDotNetBinFolder &"aspnet_regiis -pef ""connectionStrings"" """&StrInstallFolder&"""")

.....also try adding a space after '/c'.....but as VBScab says you may as well call the exe directly.....
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