如何在没有GUI的情况下隐藏Windows Update中的更新

詹森(Jason Chiang)

当您不想更新特定的Windows更新时,可以通过以下Windows 7上的步骤执行此操作:

  1. 打开Windows更新
  2. 点击查看更新
  3. 右键单击要隐藏的项目
  4. 点击隐藏

但是我想知道如何在不使用GUI的情况下进行操作。所以我可以申请多台电脑。Windows 7如何保存隐藏更新的信息?是注册表吗?我们实际上可以用一个简单的注册表文件替换这4个步骤吗?还是某种Windows脚本?

魔术师1981

用户在msfn.org发布了一个VB脚本(HideKBs_BingDesktop.vbs),该脚本隐藏了更新

' Maxpsoft May 30, 2013, 9:34:15 PM
' 06/18/2013 Add extra for Bing Desktop v1.3
' 06/28/2013 Updated to continue searching as long as it is finding something otherwise Quit
'
' Original Mike.Moore Dec 17, 2012 on answers.microsoft but when ran it Hide everything so no good.
' Link to script: http://www.msfn.org/board/topic/163162-hide-bing-desktop-and-other-windows-updates/
' You may freely use this script as long as you copy it complete and it remains the same except for adjusting hideupdates.
' If I need to change something then let me know so all may benefit.

Dim WSHShell, StartTime, ElapsedTime, strUpdateName, strAllHidden
Dim Checkagain 'Find more keep going otherwise Quit

Dim hideupdates(3) 'TO ADD 1 EDIT THE (3) AND ADD another hideupdates(#)

hideupdates(0) = "KB2592687" 'Remote Desktop Protocol 8.0
hideupdates(1) = "KB2709981" 'Windows Media Player 12
hideupdates(2) = "Bing Desktop" 'With this we get all versions
hideupdates(3) = "Silverlight"

Set WSHShell = CreateObject("WScript.Shell")

StartTime = Timer 'Start the Timer

Set updateSession = CreateObject("Microsoft.Update.Session")
updateSession.ClientApplicationID = "MSDN Sample Script"
Set updateSearcher = updateSession.CreateUpdateSearcher()
Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software' and IsHidden=0")

Checkagain = "True"

For K = 0 To 10 'Bing Desktop has 4, Silverlight has 5
If Checkagain = "True" Then
Checkagain = "False"
CheckUpdates
ParseUpdates
End if
Next

ElapsedTime = Timer - StartTime
strTitle = "Bing Desktop and Windows Updates Hidden."
strText = strAllHidden
strText = strText & vbCrLf & ""
strText = strText & vbCrLf & "Total Time " & ElapsedTime
intType = vbOkOnly

'Silent just comment these 2 lines with a ' and it will run and quit
Set objWshShell = WScript.CreateObject("WScript.Shell")
intResult = objWshShell.Popup(strText, ,strTitle, intType)

'Open Windows Update after remove the comment '
'WshShell.Run "%windir%\system32\control.exe /name Microsoft.WindowsUpdate"

Set objWshShell = nothing
Set WSHShell = Nothing
WScript.Quit


Function ParseUpdates 'cycle through updates
For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strUpdateName = update.Title
'WScript.Echo I + 1 & "> " & update.Title
For j = 0 To UBound(hideupdates)
if instr(1, strUpdateName, hideupdates(j), vbTextCompare) = 0 then
Else
strAllHidden = strAllHidden _
& vbcrlf & update.Title
update.IsHidden = True'
Checkagain = "True"
end if
Next
Next
End Function

Function CheckUpdates 'check for new updates cause Bing Desktop has 3
Set updateSession = CreateObject("Microsoft.Update.Session")
updateSession.ClientApplicationID = "MSDN Sample Script"
Set updateSearcher = updateSession.CreateUpdateSearcher()
Set searchResult = _
updateSearcher.Search("IsInstalled=0 and Type='Software' and IsHidden=0")
End Function

按照脚本中的说明编辑hideupdates数组,并添加要隐藏的KB号。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在没有GUI的情况下以VB Guest的身份在TTY中启动Ubuntu?

如何在Linux中没有其余GUI的情况下加载自己的GUI应用程序?

如何在没有重复的情况下更新

如何在 Windows 中没有桌面的情况下启动 MATLAB

如何在Racket中没有框架的[x]按钮的情况下从GUI应用程序退出

如何在没有超时的情况下锁定Ibm Db2中的更新行?

如何在没有助手的情况下更新Meteor中的div?

如何在猫鼬中没有一个对象的情况下更新架构

没有APEX的情况下如何在oracle中更新json值?

如何在没有按钮的情况下更新 tkinter 中的选项菜单?

如何在没有管理员权限的情况下确定Windows Powershell中的登录/注销时间?

Repast Java:如何在没有GUI的情况下直接在Eclipse中运行模型以及如何在没有Eclipse的情况下以无头模式运行模型

我如何在 javascript 中没有嵌套 for 循环的情况下解决这种情况

如何在没有sudo apt-get update的情况下通过Terminal更新特定软件?

如何在 sudo 和 .desktop 文件中没有主题更改的情况下打开具有 sudo 权限的 GUI

如何在没有behidcode的情况下在asp.net中隐藏图像

如何在 PhantomDriver(无头浏览器)中没有 findElement 函数错误的情况下隐藏 FirefoxDriver(使用 Selenium)?

如何在没有鼠标的情况下在Ubuntu GUI中访问终端

如何在没有 GUI 的情况下在 Thunar 中设置标志?

如何在没有任何 HTTP 调用的情况下运行 composer update?

如何在没有互联网的情况下获取更新?

如何在没有根密码的情况下运行软件更新?

如何在没有android studio的情况下更新gradle?

实体框架 - 如何在没有视图模型的情况下更新多个表

如何在没有docker-compose停机的情况下重建和更新容器?

如何在没有 BeginInvoke 或 Invoke 的情况下从异步例程更新 UI

如何在没有Android Studio的情况下更新Android模拟器?

如何在没有特定类型的情况下更新Angular管道

pygame-如何在没有时间的情况下缓慢更新HP bar