How to call xxxx.msi in vbscript.
Hi Experts,
Please can anyone help me to call "c:\test\xxx.msi" in vbscript.
i found the scenorios :
On Error Resume Next
Set sho = Wscript.CreateObject("Wscript.Shell")
strCurrentDir = Left(Wscript.ScriptFullName, (InstrRev(Wscript.ScriptFullName, "\") -1))
strCommand = "msiexec.exe /i " & chr(34) & strCurrentDir & "\widgets.msi" & chr(34) &_
" TRANSFORMS=" & chr(34) & strCurrentDir & "\widgets.mst" & chr(34) &_
" REBOOT=ReallySuppress /l*v c:\wdgt.log /qb-!"
intRet = sho.run(strCommand,0,True)
wscript.quit(intRet)
and
ScriptPath = Left(WScript.ScriptFullName, Len(WScript.ScriptFullName) - Len(WScript.ScriptName))
AppName = "AcroStan.msi"
Return = WshShell.Run("msiexec/i" chr(34) & ScriptPath &AppName &chr(34) "/qb!", 1, True)
Note: here how can i replicate my path as c:\test\xxx.msi
Thanks in advance.
Sourav.
Please can anyone help me to call "c:\test\xxx.msi" in vbscript.
i found the scenorios :
On Error Resume Next
Set sho = Wscript.CreateObject("Wscript.Shell")
strCurrentDir = Left(Wscript.ScriptFullName, (InstrRev(Wscript.ScriptFullName, "\") -1))
strCommand = "msiexec.exe /i " & chr(34) & strCurrentDir & "\widgets.msi" & chr(34) &_
" TRANSFORMS=" & chr(34) & strCurrentDir & "\widgets.mst" & chr(34) &_
" REBOOT=ReallySuppress /l*v c:\wdgt.log /qb-!"
intRet = sho.run(strCommand,0,True)
wscript.quit(intRet)
and
ScriptPath = Left(WScript.ScriptFullName, Len(WScript.ScriptFullName) - Len(WScript.ScriptName))
AppName = "AcroStan.msi"
Return = WshShell.Run("msiexec/i" chr(34) & ScriptPath &AppName &chr(34) "/qb!", 1, True)
Note: here how can i replicate my path as c:\test\xxx.msi
Thanks in advance.
Sourav.
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
anonymous_9363
15 years ago
Posted by:
captain_planet
15 years ago
Here's an adaptation of your code above. Edit the variable values accordingly. If you're not using a transform, just remove the line starting with '" TRANSFORMS' (and the blank line that it leaves behind once it's deleted)
On Error Resume Next
Set sho = Wscript.CreateObject("Wscript.Shell")
Dim intRet
'specify name of msi (without extension)
Dim msiname : msiname = "xxx"
'specify name of mst (without extension)
Dim mstname : mstname = "xxx"
'specify name of log (without extension)
Dim logname : logname = "xxxlog"
'specify location of msi
Dim strCurrentDir : strCurrentDir = "c:\test"
'specify msiexec.exe command line
Dim strCommand : strCommand = "msiexec.exe /i " & chr(34) & strCurrentDir & "\" & msiname & ".msi" & chr(34) &_
" TRANSFORMS=" & chr(34) & strCurrentDir & "\" & mstname & ".mst" & chr(34) &_
" REBOOT=ReallySuppress /l*v " & chr(34) & strCurrentDir & "\" & logname & ".log" & chr(34) & " /qb-!"
'run command
intRet = sho.Run(strCommand,0,True)
'return exit code
wscript.Quit(intRet)
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.