Windows update exe command line

Можно ли обновить Windows, используя командную строку?

Центр обновления Windows — одна из наиболее заметных функций Windows 10. Поскольку с выпуском Windows 10 Windows была предложена покупателям как услуга, а не как продукт. В сценарии «Программное обеспечение как услуга» это привело к тому, что обновления для Windows 10 были включены по умолчанию и никто не мог их отключить. Теперь, в то время как некоторые критиковали этот шаг со стороны Microsoft, в конечном итоге это шаг навстречу клиенту. Потому что Центр обновления Windows помогает пользователям оставаться защищенными от всевозможных угроз и предоставлять им новейшие и самые лучшие решения от Microsoft. Итак, тем, кто ценит этот сервис, сегодня мы поговорим о другом способе запуска этих обновлений.

1] Запустите Центр обновления Windows, используя Windows Powershell

Для запуска обновлений Windows в Windows Powershell потребуется вручную установить модуль Центра обновления Windows, загрузить загруженные обновления Windows и установить обновления Windows. И для этого откройте Windows Powershell, выполнив поиск Powershell в окне поиска Cortana и запустите его с правами уровня администратора.

Установится модуль обновления Windows для Windows Powershell.

Будет выполнено подключение к серверам Центра обновления Windows и загружены обновления, если они найдены.

Установятся обновления Windows, загруженные на ваш компьютер.

2] Запустите Центр обновления Windows с помощью командной строки

Командная строка в операционных системах Windows существует очень давно, в то время как Windows Powershell является сравнительно новым. Следовательно, он имеет аналогичные возможности для запуска обновлений Windows, но здесь следует подчеркнуть, что вам не нужно загружать какой-либо модуль для обновлений Windows.

Сначала откройте командную строку, выполнив поиск cmd в поле поиска Cortana, и запустите его с правами администратора.

Нажмите Да, чтобы получить запрос UAC.

Наконец, введите следующие команды и нажмите клавишу Enter, чтобы выполнить соответствующие операции.

Начать проверку обновлений:

Начать загрузку обновлений:

Начните установку загруженных обновлений:

Перезагрузите устройство после установки обновлений:

Проверьте, загрузите и установите обновления:

Стоит отметить, что упомянутые выше команды командной строки предназначены только для Windows 10. Для более старых версий Windows вам необходимо использовать следующие команды.

Начать проверку обновлений:

Начать установку обнаруженных обновлений:

Проверьте, загрузите и установите обновления:

Установка и управление обновлениями из командной строки

Вы не знали о том, что можете устанавливать и управлять обновлениями для ОС Windows из командной строки? Тогда прочитайте эту статью, она будет вам интересна.

Если вы загружаете обновления программного обеспечения из каталога Microsoft Update, расположенного по адресу http://catalog.update.microsoft.com/v7/site/Install.aspx?referringpage=Home.aspx, вы можете втихую загружать и устанавливать обновления из командной строки с помощью утилиты Windows Update Stand-alone Installer (Wusa.exe). Например, если .msu файл «Обновление для Windows Server 2008 (KB947562)» имеет имя X86-all-windows6.0-kb947562-x86_6ff6b13433eba0503ffcd8e47e1daefac3dc83b4.msu, вы можете установить это обновление вручную, используя следующую команду:

wusa X86-all-windows6.0-kb947562-x86_6ff6b13433eba0503ffcd8e47e1daefac3dc83b4.msu /quiet

Вы можете использовать инструментарий управления Windows из командной строки (Windows Management Instrumentation Command-line — WMIC) для просмотра установленных обновлений на вашем компьютере. Например, чтобы убедиться, что обновление, описанное в предыдущем разделе, было установлено на вашем компьютере, выполните следующие действия:

Читайте также:  Где используется операционная система linux

Caption CSName Description FixComments HotFixID InstallDate InstalledBy InstalledOn Name ServicePackInEffect Status Caption

http://support.microsoft.com/?kbid=947562 S-SC1 Update KB947562 S-1-5-21-940954651-3993729752-4124607334-500 01c8dc69493cee0b

Если результате вывода WMIC трудно читаем для вас, вы можете использовать для тех же целей Systeminfo, а именно:

Можно ли вызвать Центр обновления Windows из командной строки?

часто бывает, что я должен смотреть этот экран в течение нескольких минут:

Я понятия не имею, что происходит в спину. И я также не заинтересован в наблюдении за WindowsUpdate.log для изменения.

Я хотел бы знать, если есть способ, что дает больше обратной связи. Предпочтительно то, что я могу вызвать из командной строки (например, apt-get ).

6 ответов

в Windows 10, вы можете использовать PSWindowsUpdate модуль PowerShell.

вы можете вызвать Центр обновления Windows из командной строки с помощью wuauclt.утилита exe расположена в папке %windir%\system32\.

проверить наличие обновлений,

проверить и обновить,

Это не будет работать, если вы установили «никогда не проверять наличие обновлений» в настройках Центра Обновления Windows. Также, вероятно, автоматические обновления должны быть включены для переключения «/ updatenow » на работу (установка обновлений).

в версиях Windows до Windows 10, вы также можете запустите GUI для Центра Обновления Windows, введя следующую команду (находится в папке %windir%\system32\):

Это только открывает приложение обновления и проверяет доступные обновления, он не устанавливает их. И если вы поставили «не проверять наличие обновлений» в настройках обновления Windows, это не проверяет наличие обновлений, вам придется нажать на «кнопку обновления».

одно предложение мне очень понравилось, это WUA_SearchDownloadInstall.vbs сценарий.

доступные обновления в списке

Установки Обновления

можно использовать wusa.exe который является частью Windows 7.

хотел удалить значок обновления Windows 10 из панели задач, так что я написал это AutoHotkey скрипт, который вызывает wusa.

так что вы можете использовать wusa.exe для управления обновлениями Windows и установить .msu файлы.

этой страница имеет коллекцию других способов для управления обновлениями из командной строки.

чтобы увидеть, какие обновления установлены (через командную строку):

Я использую WuInstall. Это инструмент командной строки для управления обновлениями Windows. У вас есть много отличных опций, таких как отображение хода установки, чтобы указать, если вы хотите перезагрузить и когда, и файлы журнала доступны для каждого процесса. С уважением

Windows 10 и Windows Server 2016 или выше, используйте USOClient.exe для сканирования, загрузки и установки обновлений.

  • StartScan Используется Для Запуска Сканирования
  • StartDownload используется для запуска загрузки патчей
  • StartInstall используется для установки загруженных патчи
  • RefreshSettings обновить настройки, если были сделаны какие-либо изменения
  • StartInteractiveScan может запрашивать ввод пользователя и / или открывать диалоги, чтобы показать прогресс или сообщить об ошибках
  • RestartDevice перезагрузить устройство, чтобы закончить установку обновлений
  • ScanInstallWait Комбинированная Загрузка Сканирования Установить
  • ResumeUpdate Возобновить Установку Обновления При Загрузке

How to run Windows Updates from Command Line in Windows 10

Windows Update is one of the most highlighted features of Windows 10. Because with the release of Windows 10, Windows was offered to the customers as a service rather than a product. Under the scenario of Software as a Service, this led to the Windows Updates on Windows 10 being on by default and without an option for anyone to disable it. Now, while some criticized this move by Microsoft, ultimately this is a step towards the customer’s greater good. Because Windows Update helps the users stay secured against all kinds of threats and provide them with the latest and the greatest from Microsoft. So, those who appreciate this service, today we are going to talk about another way to run these updates.

Run Windows Updates from Command Line

The following methods will be carried out to run Windows Update from Command Line on Windows 10,

  1. Using Windows Powershell.
  2. Using Command Prompt.

1] Run Windows Update using Windows Powershell

Running Windows Updates on Windows Powershell will require you to manually Install the Windows Update module, Get Windows Updates downloaded and Install Windows Updates. And for this, open Windows Powershell by searching for Powershell in the Cortana search box and run it with Administrator level privileges.

Читайте также:  Настройка mac os под virtualbox

to install the Windows Update module for Windows Powershell.

to connect to the Windows Update servers and download the updates if found.

Finally, type in,

to install the Windows Updates downloaded on your computer.

2] Run Windows Update using Command Prompt

Command Prompt on Windows Operating Systems exists since a very long time whereas Windows Powershell is comparatively new. Hence, it has similar capabilities to run Windows Updates, but the highlighting point here is that you do not need to download any module for Windows Updates.

First, open Command Prompt by searching for cmd in the Cortana search box and run it with Administrator level privileges.

Click on Yes for the UAC Prompt that you get.

Finally, type in the following commands and hit the Enter key in order to perform the respective operations,

Start checking for updates:

Start downloading Updates:

Start installing the downloaded updates:

Restart your device after installing the updates:

Check, Download and Install Updates:

It is worth noting that, the Command Prompt commands mentioned above are just meant for Windows 10. For older versions of Windows, you need to use the following commands,

Start checking for updates:

Start installing the detected Updates:

Check, download, and install updates:

Hope you find this post useful.

How To Run Windows Update From Command Line

In Windows 10, Windows Update can be found in Settings –> Update & Security –> Windows Update. Normally Windows Update keeps on running in the background and will install new updates automatically.

You can also run Windows Update manually to check for new updates at any time. Here are three ways to check for new Windows updates.

Check for Windows updates using Windows Settings

To check for new updates and configure Windows Update settings, follow the steps below:

  1. Open Windows Settings (Windows key + i).
  2. Choose Update & Security.
  3. Choose Windows Update from the left hand menu.
  4. Press the Check for updates button in the right hand pane.

Check for updates

Run Windows Update from PowerShell (Command-line)

There is a PowerShell module for Windows Update. You can install and run the module to check for new updates. There are three steps for running Windows Update through PowerShell. Run the following commands step by step:

  1. Install-Module PSWindowsUpdate Install Module PSWindowsUpdate

This will install the Windows Update module in PowerShell.
Get-WindowsUpdate Get WindowsUpdate

This command will check for updates.
Install-WindowsUpdate Install WindowsUpdate

This command will install the available updates (which were listed in step 2)

Run Windows Update from Command Prompt (Command-line)

Windows Update can also be run through legacy CMD. The only limitation running Windows Update through command prompt is that it won’t show any progress. Only results are shown. Let’s see how to run it:

  • Go to Run –> cmd
  • Run the following command to check for new updates:
    wuauclt /detectnow
  • Run the following command to install new updates
    wuauclt /updatenow

Since the command prompt does not show any progress, a better approach would be to check and install updates at the same time. Here’s the command for this:

wuauclt /detectnow /updatenow

The above mentioned command will work in all versions of Windows including Windows 7 and Windows Server 2008 R2. But if you are using Windows 10 or Windows Server 2016, you can use UsoClient command which has more options than wuauclt. You can run UsoClient with the following switches:

Читайте также:  Где находится вкладка общие windows

StartScan – Start checking for updates

StartDownload – Start downloading updates

StartInstall – Start installing downloaded updates

RestartDevice – Restart Windows after updates are installed

ScanInstallWait – Check for updates, download available updates and install them

Hopefully this will be useful in situations where you want to automate certain Windows functions. What other purposes do you want to use command line options for running Windows Update?

Continue Reading:

Usman Khurshid is a seasoned IT Pro with over 15 years of experience in the IT industry. He has experience in everything from IT support, helpdesk, sysadmin, network admin, and cloud computing. He is also certified in Microsoft Technologies (MCTS and MCSA) and also Cisco Certified Professional in Routing and Switching. Reach him at Twitter @usmank11

14 thoughts on “ How To Run Windows Update From Command Line ”

Thank you Usman! Wow Microsoft has a new cli USOClient.exe awesome!

Thank you. Refurbished machine – needed to update in order to move from other machine to “new to me” machine after just getting ti to cooperate with the network. I have never run across a machine that would not update before. The cmd options did not work, but the PS option was exactly what I needed. Added to my bag of tricks. Thank you so much!!

usoclient.exe /StartScan does not update the shown ‘Last checked date’ shown in the GUI on a Windows Server 2016 or 2019.

PS C:\> Start-Service wuauserv -Verbose
PS C:\> $updateSession = new-object -com “Microsoft.Update.Session”;$updates=$updateSession.CreateupdateSearcher().Search($criteria).Updates
PS C:\> (New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()

This is work on a Windows 10 – the Last checked time is updated in the GUI
BUT it’s not workting om Windows 2016 or 2019

Any know of a way to make this work on a Server 2016 ??

I don’t get any of these from article to work. Not even: Start-Service wuauserv -Verbose

PS C:\WINDOWS\system32> Start-Service wuauserv -Verbose
VERBOSE: Performing the operation “Start-Service” on target “wuauserv (wuauserv)”.
Start-Service : Failed to start service ‘wuauserv (wuauserv)’.
At line:1 char:1
+ Start-Service wuauserv -Verbose
+

+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
ServiceCommandException
+ FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

Please run PowerShell with administrative privileges.

usoclient StartScan does NOT make any changes to the Last checked date shown in the GUI
Neither does the Powershell command Get-WindowsUpdate

In previous Windows I had to updating the Last checked value in registry after performing a scan using the API (as they dont). But MS has moved the location to an unknown place i 2016 and 2019.

Anyone who knows how to update the “Last checked date” from CMD or API .

Function Force-WSUSCheckin($Computer)
<
Invoke-Command -computername $Computer -scriptblock < Start-Service wuauserv -Verbose >
# Have to use psexec with the -s parameter as otherwise we receive an “Access denied” message loading the comobject
$Cmd = ‘$updateSession = new-object -com “Microsoft.Update.Session”;$updates=$updateSession.CreateupdateSearcher().Search($criteria).Updates’
& c:\bin\psexec.exe -s \\$Computer powershell.exe -command $Cmd
Write-host “Waiting 10 seconds for SyncUpdates webservice to complete to add to the wuauserv queue so that it can be reported on”
Start-sleep -seconds 10
Invoke-Command -computername $Computer -scriptblock
<
# Now that the system is told it CAN report in, run every permutation of commands to actually trigger the report in operation
wuauclt /detectnow
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
wuauclt /reportnow
c:\windows\system32\UsoClient.exe startscan
>
>

Hi Glenn, thank you for such a detailed explanation.

Get-WindowsUpdate: The ‘Get-WindowsUpdate’ command was found in the module ‘PSWindowsUpdate’, but the module could
not be loaded. For more information, run ‘Import-Module PSWindowsUpdate’.
At line:1 char:1
+ Get-WindowsUpdate
+

+ CategoryInfo : ObjectNotFound: (Get-WindowsUpdate:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

To remedy that, please try the following:
1. Run Set-ExecutionPolicy -ExecutionPolicy Unrestricted
2. Run Import-Module PSWindowsUpdate
3. Try running Get-WindowsUpdate again.
This worked for me.

Оцените статью