0

我对vbs不熟悉。我已经尝试了几种变体。我正在尝试在安装软件更新之前进行卸载先决条件。我也希望它静默卸载。对此的任何帮助表示赞赏。

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

如果我oWMIval.IdentifyingNumber用实际的 GUID 替换它就可以了。谢谢

4

1 回答 1

0
WshShell.Run "msiexec /x " & oWMIval.IdentifyingNumber,1,True
于 2013-10-26T17:01:18.330 回答