通过 CMD 批处理文件卸载 Windows 更新

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30600311/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:06:37  来源:igfitidea点击:

Uninstalling Windows Updates via CMD Batch File

windowsbatch-filecmdupdatesuninstall

提问by n9x

I am trying to put together a batch script that will quietly remove a specific windows update. I have the KB #.

我正在尝试组合一个批处理脚本,该脚本将悄悄删除特定的 Windows 更新。我有知识库#。

I cant seem to find a seamless way to do this so far. Is there a way to uninstall via a GUID of sorts? If so, how do you find the GUIDs of each specific installed windows update?

到目前为止,我似乎无法找到一种无缝的方法来做到这一点。有没有办法通过各种 GUID 卸载?如果是这样,您如何找到每个特定安装的 Windows 更新的 GUID?

回答by CristiFati

According to MSDN, in order to uninstall update #980302, you should use the command:

根据MSDN,要卸载更新 #980302,您应该使用以下命令:

wusa /uninstall /kb:980302

As the documentation and wusa /?doesen't reveal anything about specifying more /kbs, your batch file should consist of several above lines (one per kb#).

由于文档并没有wusa /?透露有关指定更多/kbs 的任何信息,您的批处理文件应由以上几行组成(每个 kb# 一行)。

Don't forget to run your batch file as Administrator!

不要忘记以管理员身份运行您的批处理文件!

回答by Alex K.

wusacan uninstall by KB number:

wusa可以通过KB号卸载:

wusa /uninstall /kb 123456