Uninstall by Guid example - vbscript

usage: cscript/wscript NameOfScript.vbs {GUID} {GUID} etc.; again, just putting it here mostly for myself for reference.

On error resume Next

CountApps = Wscript.Arguments.Count
If Wscript.Arguments.Count = 0 Then
 'nothing to do
 wscript.quit(0)
End If

For i = 0 to CountApps
 For Each Product In GetObject("winmgmts:{impersonationLevel=impersonate}!//localhost").ExecQuery("select * from Win32_Product where IdentifyingNumber='" & wscript.arguments(i) & "'")
  Product.Uninstall
 Next
Next

wscript.quit(0)

Published Friday, September 08, 2006 2:53 PM by skissinger

Comments

No Comments