首页 > 解决方案 > 使用 Start-Process 运行 Wusa.exe /uninstall 不起作用

问题描述

我一直在尝试通过 powershell 卸载更新。我正在尝试使用启动进程来利用 wusa.exe。当我通过卸载和安静开关时,它无法运行。我在设置事件日志中收到此错误:

Windows update  could not be uninstalled because of error 2147942487 "The parameter is incorrect." (Command line: ""C:\WINDOWS\system32\wusa.exe" /KB:4512516 /uninstall  /quiet /norestart ")

我已经读过您必须对 Windows 10 执行不同的操作,但我找不到任何示例。我怎么能运行这个?如果我在没有静音的情况下运行它,它会弹出窗口以毫无问题地卸载更新。

这是我要运行的。

Start-Process -FilePath wusa.exe -ArgumentList "/uninstall /KB:4512516 /quiet /norestart" -ErrorAction SilentlyContinue -WindowStyle Hidden -Wait

标签: windowspowershellupdatesuninstallationstart-process

解决方案


找到 Remove-Windowspackage cmdlet,它是 powershell 中的本机 cmdlet。改用那个。


推荐阅读