vbs msiexec / x编码不正确

时间:2013-10-26 14:46:07

标签: vbscript

我对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,它就可以了。 感谢

1 个答案:

答案 0 :(得分:0)

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