[wpkg-users] GetMSIProperties

Stefan Pendl stefan.pendl.71 at gmail.com
Thu Oct 16 07:42:22 CEST 2014


Am 16.10.2014 um 07:11 schrieb heiko.helmle at horiba.com:
> you mean something like this snippet?
>
> Set objWMIService = GetObject("winmgmts:" _
>     & "{impersonationLevel=impersonate}!\\" _
>     & "." & "\root\cimv2")
> Set colSoftware = objWMIService.ExecQuery _
>     ("Select * from Win32_Product " _
>         & "Where Name LIKE '" & software & "%'")
> ' this sometimes bombs out for unknown reasons
> on error resume next
> if colSoftware.Count > 0 then
>         For Each objSoftware in colSoftware
>       wscript.echo objsoftware.name
>       'can't use .uninstall because it causes immediate reboots!!!
>       'objSoftware.Uninstall()
>       dim msiid, rc
>       msiid = objSoftware.IdentifyingNumber
>       rc = WshShell.Run ("msiexec /passive /qn /norestart /x " & msiid 
> & " " & extraArgs, 1, true)
>       if rc = 3010 then
>               wscript.echo "Reboot requested!"
>               rebootwanted = true
>       end if
>         Next
> end if
>

By the way, /qn is deprecated.

/passive is the new equivalent to /qn!, so there is no need to specify 
/qn if you use /passive.


--
Stefan P.

Top-posting:
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20141016/534d07ba/attachment-0003.html>


More information about the wpkg-users mailing list