2011-10-29 18:42:56 +0000 2011-10-29 18:42:56 +0000
25
25
Advertisement

如何强制Windows检查更新?

Advertisement

在全新安装Windows–XP或7之后,如何 “强制 "Windows更新?

我不想一周后Windows更新就 "老 "了,那能不能 "一步到位"?有没有什么 "神奇 "的命令可以强制Windows检查更新,如果有,就安装?

Advertisement

答案 (7)

40
40
40
2011-10-29 21:08:34 +0000

除了使用Windows Update的常规方式外,你还可以从命令行强制检查。

打开一个管理员命令提示符并运行。

C:\> %windir%\system32\wuauclt.exe /detectnow

Wuauclt.exe是Windows Update的自动更新客户端,用于检查微软更新的可用更新(针对不同版本的MS Windows平台)。

这不会强制安装。

12
12
12
2011-10-29 21:25:14 +0000

您可以使用脚本自动检查和安装更新。这将在XP或Windows 7中工作。

有很多脚本可以下载,这里是我的

' Written in 2007 by Harry Johnston, University of Waikato, New Zealand.
' This code has been placed in the public domain. It may be freely
' used, modified, and distributed. However it is provided with no
' warranty, either express or implied.
'
' Exit Codes:
' 0 = scripting failure
' 1 = error obtaining or installing updates
' 2 = installation successful, no further updates to install
' 3 = reboot needed; rerun script after reboot
'
' Note that exit code 0 has to indicate failure because that is what
' is returned if a scripting error is raised.
'

Set updateSession = CreateObject("Microsoft.Update.Session")

Set updateSearcher = updateSession.CreateUpdateSearcher()
Set updateDownloader = updateSession.CreateUpdateDownloader()
Set updateInstaller = updateSession.CreateUpdateInstaller()

Do

  WScript.Echo
  WScript.Echo "Searching for approved updates ..."
  WScript.Echo

  Set updateSearch = updateSearcher.Search("IsInstalled=0")

  If updateSearch.ResultCode <> 2 Then

    WScript.Echo "Search failed with result code", updateSearch.ResultCode
    WScript.Quit 1

  End If

  If updateSearch.Updates.Count = 0 Then

    WScript.Echo "There are no updates to install."
    WScript.Quit 2

  End If

  Set updateList = updateSearch.Updates

  For I = 0 to updateSearch.Updates.Count - 1

    Set update = updateList.Item(I)

    WScript.Echo "Update found:", update.Title

  Next

  WScript.Echo

  updateDownloader.Updates = updateList
  updateDownloader.Priority = 3

  Set downloadResult = updateDownloader.Download()

  If downloadResult.ResultCode <> 2 Then

    WScript.Echo "Download failed with result code", downloadResult.ResultCode
    WScript.Echo

    WScript.Quit 1

  End If

  WScript.Echo "Download complete. Installing updates ..."
  WScript.Echo

  updateInstaller.Updates = updateList

  Set installationResult = updateInstaller.Install()

  If installationResult.ResultCode <> 2 Then

    WScript.Echo "Installation failed with result code", installationResult.ResultCode

    For I = 0 to updateList.Count - 1

      Set updateInstallationResult = installationResult.GetUpdateResult(I)
      WScript.Echo "Result for " & updateList.Item(I).Title & " is " & installationResult.GetUpdateResult(I).ResultCode

    Next

    WScript.Quit 1

  End If

  If installationResult.RebootRequired Then

    WScript.Echo "The system must be rebooted to complete installation."

    WScript.Quit 3

  End If

  WScript.Echo "Installation complete."

Loop

你从命令行运行这个,像这样。

cscript wsusupdate.vbs

我的脚本只是最低限度的功能,但可能仍然有用。还有其他类似的脚本,有很多额外的功能,可以尝试在Google上搜索。

5
Advertisement
5
5
2011-10-29 20:20:39 +0000

要检查更新,请进入 “控制面板"、"安全"、"Windows更新",然后点击 "检查更新"。

2
2
2
2016-04-12 04:16:42 +0000

强制重新扫描更新的另一种方法是擦拭干净,通过删除存储在%windir%/Windows/SoftwareDistribution/Download中的所有更新。

NET STOP wuauserv
    RD /S /Q %windir%\SoftwareDistribution\Download
    NET START wuauserv

然后进入Windows更新,然后 “检查更新"。这可能需要一个小时,因为系统卷上的每个可更新文件都会被检查(后续的 "检查更新 "会很快)。这种方法可以消除错误、拙劣的更新,并产生一个干净的、最新的系统,至少在MS看来是这样。

1
Advertisement
1
1
2012-06-29 09:34:18 +0000

我使用的是一个名为wuinstall的第二方工具,用于更新新鲜的Windows安装。

0
0
0
2011-10-29 23:27:11 +0000

我发现,如果作为Windows 7上全新安装的一部分,你升级了IE,或者你还没有运行IE并回答了介绍性问题,Windows Update会给你一个错误。我也没有找到一种方法来切换Windows Update到Microsoft Update,而不通过GUI,所以我手动启动IE,让它初始化,然后通过GUI设置Windows Update,所以我可以切换到Microsoft Update,避免最初的错误。你的里程数可能会有所不同。

0
Advertisement
0
0
2014-02-04 04:51:50 +0000

我按照这个帖子的步骤成功了,通过安装IE8WI4.5,会触发自动更新开始下载。

Advertisement
Advertisement