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.
0 Comments   [ + ] Show Comments

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.

Answers

0
- One, your post really ought to be in the 'Scripts' forum;
- Two,
- create C:\TEST
- drop the script and MSI into C:\TEST

Both scripts use the name of the folder which contains the script to build a variable and then use the variable in the command line.
Answered 02/10/2009 by: VBScab
Red Belt

Please log in to comment
0
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)
Answered 02/10/2009 by: captain_planet
Second Degree Brown Belt

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