Powered By Blogger

Wednesday, July 31, 2013

Passing parameter to command line option of setup.exe - using VB Script

1.       Installation of setup.exe in silent mode by passing arguments.

How to Run setup.exe in silent>

            strEXE = here & "\setup.exe"
commandline=""& strEXE &" /s “
retVal=wsh.Run(commandline, 1, true )

                How to pass parameters in silent mode installation

                        here = fso.GetParentFolderName(Wscript.ScriptFullName)
wsh.CurrentDirectory = here
INSTALLDIR="\"& chr(34) &"C:\TEST Folder\My Dest\"& chr(34)
REPLACETHIS="\"& chr(34) &"APPNAME_2013_V3\"& chr(34)
REPLACE2="\"& chr(34) &"APPNAME\"& chr(34)
REPLACEDESCR="\"& chr(34) &"Information\"& chr(34)
LogFile ="C:\Test\My Logs\MyTest EXE.log"

strParams = "INSTALLDIR=" & INSTALLDIR & _
                " REPLACETHIS=" & REPLACETHIS &  _
                " REPLACE2=" & REPLACE2 & _
                " REPLACEDESCR=" &REPLACEDESCR& _
                ""
strEXE = here & "\setup.exe"
commandline=""& strEXE &" /s /v""/qb /L*v \"""& LogFile &"\"" " & strParams & "" & chr(34)
retVal=wsh.Run(commandline, 1, true )

msgbox(retVal)

No comments: