/build/static/layout/Breadcrumb_cap_w.png

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!


0 Comments   [ + ] Show comments

Answers (3)

Posted by: terebent 10 years ago
Second Degree Brown Belt
1

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

 

Posted by: SnowLyric 10 years ago
Second Degree Brown Belt
-1

why do you use /v /qn with an answer file?

Try

c:\temp\EXE filename /s /f1"c:\temp\answer file name.iss"

Posted by: asman 10 years ago
Purple Belt
-1

Commandline = chr(34) & "c:\temp\EXE_filename" & chr(34) & " /s /f1" & chr(34) & " c:\temp\answer file name.iss" & chr(34)
YEEAH = WshShell.Run(Commandline, 1, true)


Comments:
  • no space inside "c:\temp\answer file name.iss" ofc.. - asman 10 years ago
 
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