我对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
如果我用实际的GUID替换oWMIval.IdentifyingNumber
,它就可以了。
感谢
答案 0 :(得分:0)
WshShell.Run "msiexec /x " & oWMIval.IdentifyingNumber,1,True