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


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


- 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.
Answered 08/11/2009 by: VBScab
Red Belt

Please log in to comment
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.....
Answered 08/11/2009 by: captain_planet
Second Degree Brown Belt

Please log in to comment
Answer this question or Comment on this question for clarity