WshShell.Run command for an executable with an answer file (iss)
I'm trying to get the syntax down for a run line. I'm sure it has got to do with another set of parens or quotation marks, but I've tried quite a few scenarios with no luck. It keeps bombing at the beginning of the answer file right after the quotation mark. Here is the command line if you were to use it in a command prompt and it does work fine that way:
c:\temp\EXE filename /s /v /qn /f1"c:\temp\answer file name.iss"
Could anyone help with that? Right now to work around the issue I just run a batch file from my vbs file. My vbs file does a few other things prior to running this command, but I would like to have it all in the vbs file. Thank you for your help!
Answers (3)
Here is a fuction:
'Usage: Place the script in the same folder with exe file.
Launch_App "setup.exe", "/s /v /qn /f1""c:\temp\answer file name.iss""
Function Launch_App (strExePath, strArg)
Dim strScriptPath : strScriptPath = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\")-1)
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run """" & strScriptPath & "\" & strExePath & """" & " " & strArg,,True
End Function