All things SMS, System Center Configuration Manager, Active Directory, Group Policy, Virtualization, Security, Gadgets, Technology, and the Daily Thoughts of an SMS Engineer named Anthony Clendenen.

The Daily Ramblings of an SMS Engineer

How To Trap The Exit Code With VBS From an MSI Package

September 28, 2006

From the forums: http://www.myitforum.com/forums/m_142866/mpage_1/key_/tm.htm#142884

Original source:

VBScript & SMS packaging? - 9/27/2006 10:05:05 PM
No New Messages
jsichak
Starting Member



Posts: 25
Score: 0
Joined: 5/26/2005
Status: offline Does anyone know if there is a good way to pass error codes from an MSI or other external application from a VBScript to SMS? We have done several packages that basically call and MSI along with some other customizations, and would like to have an accurate count as to whether the installation of the MSI went well or not.

Thanks!



_____________________________

Jeremy Sichak
SMS Admin/Workstation Architect
jeremysichak at allianzlife.com
[Send Private Message] Report | Rate post | Post #: 1
RE: VBScript & SMS packaging? - 9/28/2006 5:00:51 AM 1 votes
No New Messages
skissinger
Expert Member



Posts: 317
Score: 33
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline I do it all the time; example:

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)

VBScript & SMS packaging?.

the daily ramblings of an sms engineer listen to this article '> Listen to this article
Filed under: ,

Comments

  • # On Thursday, September 28, 2006 11:28 AM skissinger said:

    Oops; noticed syntax was incorrect in the example.

    I needed a " and a space before TRANSFORMS; i.e.,

    " TRANSFORMS=" &