0
votes

I am unfamiliar with vbs. I have tried several variations of this. I am trying to do an uninstall prerequisite before installing the software update. I also want this to uninstall silently. Any help with this is appreciated.

Set oWMIroot = GetObject("WinMgmts:root/cimv2")
Set oWMIColl = oWMIroot.ExecQuery("Select IdentifyingNumber, Name  FROM Win32_Product") 
  For Each oWMIval In oWMIColl
if oWMIval.Name = "John's MIND" then
 'WScript.Echo oWMIval.Name & " = " & oWMIval.IdentifyingNumber ' this is correct

  Set WshShell = CreateObject("WScript.Shell")
  WshShell.Run "msiexec /x  oWMIval.IdentifyingNumber",1,True

End if
Next

If I replace oWMIval.IdentifyingNumber with the actual GUID it works. Thanks

1
This is a common mistake, covered in the VBScript tag wiki. - Ansgar Wiechers

1 Answers

0
votes
WshShell.Run "msiexec /x " & oWMIval.IdentifyingNumber,1,True