<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Am 16.10.2014 um 07:11 schrieb
<a class="moz-txt-link-abbreviated" href="mailto:heiko.helmle@horiba.com">heiko.helmle@horiba.com</a>:<br>
</div>
<blockquote
cite="mid:OF6B7DDAF8.6487BA4F-ONC1257D73.001C1CF8-C1257D73.001C7AC9@smtpgw.horiba.co.jp"
type="cite"><font face="sans-serif" size="2">you mean something
like this snippet?</font>
<br>
<br>
<font face="sans-serif" size="2">Set objWMIService =
GetObject("winmgmts:"
_</font>
<br>
<font face="sans-serif" size="2"> &
"{impersonationLevel=impersonate}!\\"
_</font>
<br>
<font face="sans-serif" size="2"> & "." &
"\root\cimv2")</font>
<br>
<font face="sans-serif" size="2">Set colSoftware =
objWMIService.ExecQuery
_</font>
<br>
<font face="sans-serif" size="2"> ("Select * from Win32_Product
" _</font>
<br>
<font face="sans-serif" size="2"> & "Where
Name LIKE '" & software & "%'")</font>
<br>
<font face="sans-serif" size="2">' this sometimes bombs out for
unknown
reasons</font>
<br>
<font face="sans-serif" size="2">on error resume next</font>
<br>
<font face="sans-serif" size="2">if colSoftware.Count > 0 then</font>
<br>
<font face="sans-serif" size="2"> For
Each objSoftware in colSoftware</font>
<br>
<font face="sans-serif" size="2">
wscript.echo objsoftware.name</font>
<br>
<font face="sans-serif" size="2">
'can't use .uninstall because it causes immediate
reboots!!!</font>
<br>
<font face="sans-serif" size="2">
'objSoftware.Uninstall()</font>
<br>
<font face="sans-serif" size="2">
dim msiid, rc</font>
<br>
<font face="sans-serif" size="2">
msiid = objSoftware.IdentifyingNumber</font>
<br>
<font face="sans-serif" size="2">
rc = WshShell.Run ("msiexec /passive
/qn /norestart /x " & msiid & " " & extraArgs,
1, true)</font>
<br>
<font face="sans-serif" size="2">
if rc = 3010 then </font>
<br>
<font face="sans-serif" size="2">
wscript.echo
"Reboot requested!"</font>
<br>
<font face="sans-serif" size="2">
rebootwanted
= true</font>
<br>
<font face="sans-serif" size="2">
end if</font>
<br>
<font face="sans-serif" size="2"> Next</font>
<br>
<font face="sans-serif" size="2">end if</font>
<br>
<font face="sans-serif" size="2"></font><br>
</blockquote>
<br>
By the way, /qn is deprecated.<br>
<br>
/passive is the new equivalent to /qn!, so there is no need to
specify /qn if you use /passive.<br>
<pre class="moz-signature" cols="72">
--
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?</pre>
</body>
</html>