用于卸载软件的VBScript

用于卸载软件的VBScript,vbscript,Vbscript,我正在尝试使用VBScript卸载软件。当我运行它时,它似乎只处理第一次点击,然后结束。我有什么错,它没有循环通过strPublisher中sMatch的每个实例 sMatch = "Mitel Networks Corporation" On Error Resume Next Const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set WshShell = CreateObject("Wscript.Shell") Set

我正在尝试使用VBScript卸载软件。当我运行它时,它似乎只处理第一次点击,然后结束。我有什么错,它没有循环通过strPublisher中sMatch的每个实例

sMatch = "Mitel Networks Corporation"
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set WshShell = CreateObject("Wscript.Shell")
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
   strPublisher = ""
   strPublisher = WshShell.RegRead ("HKLM\" & strKeyPath & "\" & subkey & "\Publisher")
   If InStr(1, strPublisher, sMatch) >0 Then
      WshShell.Run "cmd /c C:\Windows\System32\msiexec.exe /X" & SubKey & " /L*V msilog.txt", 1, True
      WScript.Sleep 50000
   End If
Next
谢谢

注释掉:
出错时继续下一步 您可能会遇到导致该问题的错误。你有什么错误