Update windows from commandline

Можно ли обновить 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 вам необходимо использовать следующие команды.

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

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

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

Command-line switches for Microsoft software update packages

This article describes the consistent set of command-line switches that Microsoft is adopting for deploying packages that contain software updates.

Original product version:  Windows 10 – all editions
Original KB number: В 824687

Summary

Microsoft is adopting a consistent set of command-line switches that you can use to deploy packages that contain software updates, such as security updates, critical updates, and hotfixes. This article describes these new command-line switches and their behaviors.

Packages that support these new command-line switches also support earlier command-line switches for backwards compatibility. However, usage of the earlier switches should be discontinued as this support may be removed in future software updates.

For additional information about command-line switches that are used by Windows software update packages, click the following article number to view the article in the Microsoft Knowledge Base:

262841 Command-line switches for Windows software update packages

For additional information about command-line switches used by Windows Installer, visit the following Microsoft Web site:

For additional information about the standard terminology that Microsoft is adopting to describe software updates, click the following article number to view the article in the Microsoft Knowledge Base:

More information

Microsoft is adopting the following command-line switches for software update packages:

Читайте также:  Forbidden windows kernel modification detected что это

/help; /h; /? — Displays a dialog box that shows the correct usage of the Setup command, including a list of all its command-line switches and their behaviors. You can display this help information in the command-line interface (CLI) or the graphical user interface (GUI). If you use any command-line switch incorrectly, this help switch is invoked and the correct usage is displayed. The dialog box also provides references to more online information.

/quiet — Runs the Setup program or the removal program in «quiet» mode. The program doesn’t prompt the user with any messages. The program enters all messages in a log file. By default, the program restarts the computer with no prompt or warning if the process requires a restart for the changes to take effect. To change the default restart behavior, use a different restart mode.

/passive — Runs the Setup program or the removal program in «passive» mode. The program doesn’t prompt the user with any error messages. The user sees a progress bar that indicates that the installation or the removal is occurring. The user can’t cancel the installation or the removal. By default, the program invokes the /warnrestart switch. If the program is installing multiple updates, the progress bar indicates the progress of the installation or the removal for each update.

/norestart — Doesn’t restart the computer after the installation or the removal, even if the process requires a restart for the changes to take effect.

/forcerestart — Restarts the computer after the installation or the removal, even if the process doesn’t require a restart for the changes to take effect. Restarting forces programs that are running to close.

/warnrestart[:x ] — Invokes a dialog box that warns the user that a restart will occur in x seconds (in 30 seconds if no value is specified). For example, to warn that a restart will occur in 60 seconds, type /warnrestart:60. The dialog box contains a Cancel button and a Restart Now button. If the user clicks Cancel, the computer isn’t restarted.

/promptrestart — Prompts the user that the computer must be restarted for the changes to take effect. The user can select whether to restart the computer.

/uninstall — Removes the package.

/log — Enables the user to define the path for the local log file. This switch invokes the default logging behavior.

/extract — Enables you to extract the installation files to a specified folder.

Run command for Windows update

There are couple of Run commands for Windows update. The run commands are very handy to launch an application quickly without the need to find the same in list of programs or on filesystem. WindowsВ has a run command for almost every application or configuration tool.

The run commands for Windows update are wuapp (or) control update . So to launch Windows update from Run, you need to perform the below steps.

  1. OpenВ Run with [Win]+[R] shortcut or from Start menu.
  2. Type in either of ‘wuapp’ or ‘control update’ and press ‘Enter’

This launches windows update configuration window. Here you can click ‘Settings’ and then configure how you want to install updates on to your computer.

If you just want to trigger updates click on ‘Check for updates’. Note that there’s no run command that can trigger update directly

For Windows 10 the run command is:
ms-settings:windowsupdate

I prefer run commands over other ways as it seems faster to me. Here are some run commands which I use daily for opening various windows applications .
On screen Keyboard – osk
Calculator – calc
WordPad – write
Windows Media Player – wmplayer
Windows Fax and Scan – wfs
Snipping Tools – snippingtool
Paint – mspaint
Notepad – notepad
Task manager – taskmgrt/
Sticky Notes – stikyno

For Windows v1809+ I find this works from the command line:

Читайте также:  Очистить диск windows cmd

You can also stop & start the Windows Update service prior:

Disable or Enable Windows Automatic updates from command line

We can disable Windows automatic updates from command line using the below command.

I tested this on Windows XP, Windows server 2003 and Windows 7 and it works perfectly. After running the above command you can also see a balloon popping up near the system tray with the message “Your computer might be at risk… Automatic updates is turned off……“.

Note that this will not work if domain group policy is enforced and users are prohibited to change the settings. In Widows 7, we can find out if a GP is enforced or not by opening windows update window. Go to settings and see if the options are greyed out for ‘Important updates’. If so, then it’s controlled by administrator/domain policy and can’t be edited. In XP, same can be checked on ‘Automatic updates’ tab in Computer properties(sysdm.cpl).

To enable automatic updates we need to set the registry value to 0. Command is given below.

If you want to download updates but not install till the user acts on it then you can set the registy value to 3.

If you want to disable Automatic updates service then run the below command.

IF you want to stop Automatic updates service then run the below command.

Command for starting automatic updates service:

Command for enabling the service:

Errors

In Vista/Windows 7, the above commands should be run from elevated administrator command prompt. Otherwise you would get the following error.

Thanks for the tip.. I tried this on Windows 7 and it worked perfectly. Thanks again.

thanks mate. one question, does this command only disable? or does it enable and disable?

I believe if you do “net start wuauserv”. The windows update will start to work

to disable you type in “net stop wuauserv” in the command promt.

It can be used to enable also. The command would vary slightly.. just replace 1 with 0. Please see the command below after making this change..

reg add «HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update» /v AUOptions /t REG_DWORD /d 0 /f

Thanks i tested that with Vista it worked for that too .
In my windows update page was having error i did nt have any way other than to disable or enable automatic updates through command prompt.

and 3 means Download udates but do not install

Thank you so much!! Saved me from infinite looping on Vista Ultimate with automatic updates.

Glad that the tip helped you..keep visiting the blog for many more tips..thank you..

How to check if windows automatic update is on?

Get the registry value using ‘reg query’ command. you can know the updates on/off status based on the registry value

Thank you for pointing out the relevant registry keys and how to modify them, the information was most helpful.

The Access Denied message comes if you don’t run command using Administrator privileges, the command works perfectly..you can as well use the GUI..it works perfectly

Run cmd as administrator

It works very perfectly.

Sweet. This worked perfectly and all on a remote machine in another country…. I just fell in love with psexec again…

Tested on Windows 8, works perfectly, went over a nasty virus that destroyed my admin access for many things such as Windows Update (can’t be eliminated without formatting the computer and I can’t afford to lose my programs).

Does nothing. According to the windows update page on control panel it says its still on auto update. And I can’t turn it off from there thats why I wanted a alternative like this.

sounds like id-10-t error ….

I have tested this on Windows 10 Technical Preview and it can disable and stop the windows update service – will not issue

Читайте также:  Sentinel hasp driver linux

in this one the options are locked and the update have to be on all the time.

The last update keeps going to error: DPC Watchdog Violation and meant i had to keep rolling back my Laptop for it to work

Now i have no issue as the upated are fully disable and not running any more lol

If you use this on Windows 10 Tech Preview: Run CMD in Admin for it to work…

I’m looking at Windows 7 and 10 and the value for automatic install of updates is 4, not zero. Zero is disabled. I’ve tested this myself by manually changing the setting and looking at the change in the registry.

Wondering if there is a way to have it NOT download and install IE 11. We have a client that runs software that is not compatible with that. They have close to 500 machines and for some reason their Corporate IT lets them slide on doing updates and rebooting. Ive got around 300 of those machines that need updates ran and this makes it much more time effective than calling each user and remoting into their machine.

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.

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.

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