Install all windows updates command line

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

Вы не знали о том, что можете устанавливать и управлять обновлениями для ОС 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) для просмотра установленных обновлений на вашем компьютере. Например, чтобы убедиться, что обновление, описанное в предыдущем разделе, было установлено на вашем компьютере, выполните следующие действия:

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, а именно:

Installing Updates from the Command Prompt

Applies to: SQL Server (all supported versions) — Windows only

Test and modify installation scripts to meet the needs of your organization.

Sample Syntax for Installation

The name of the update package can vary and may include a language, edition, and processor component. Apply an update at a command prompt, replacing

with the name of your update package:

Update a single instance of SQL Server and all shared components, like Integration Services and Management Tools: You can specify the instance either by using the InstanceName parameter or the InstanceID parameter. To update a prepared instance of SQL Server, you must specify the InstanceID parameter.

Setup can integrate the latest product updates with the main product installation so that the main product and its applicable updates are installed at the same time. You can prepare an installation of database engine instance to include product update:

Update SQL Server shared components only, like Integration Services and Management Tools:

Update all instances of SQL Server on the computer and all shared components, like Integration Services and Management Tools:

Remove an update from a single instance of SQL Server and all shared components, like Integration Services and Management Tools:

Remove an update from SQL Server shared components only, like Integration Services and Management Tools:

The update installer ensures that the shared components are always at or above the version of the instance at the highest level.

Supported parameters

When possible, supply security credentials at run time. If you must store credentials in a script file, secure the file to prevent unauthorized access.

Switch Description
/? Displays unattended installation command prompt help
/action=Patch or /action=RemovePatch Specifies the installation action: Patch or RemovePatch.
/allinstances Applies the SQL Server update to all instances of SQL Server and to all SQL Server shared, instance-unaware components.
/instancename=InstanceName* Applies the SQL Server update to an instance of SQL Server named InstanceName, and to all SQL Server shared, instance-unaware components.
/InstanceID=Inst1 Applies the SQL Server update to an instance of SQL Server Inst1, and to all SQL Server shared, instance-unaware components.
/quiet Runs the SQL Server update Setup in unattended mode.
/qs Displays only the progress UI dialog.
/UpdateEnabled Specifies whether SQL Server setup should discover and include product updates. The valid values are True and False or 1 and 0. By default, SQL Server setup will include updates that are found.
/IAcceptSQLServerLicenseTerms Required only when the /Q or /QS parameter is specified for unattended installations.

*You cannot specify this parameter to apply an update to a prepared instance of SQL Server. You must specify the /instanceID parameter instead.

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:

/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.

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.

How to install Windows Updates from command-line

Is it possible to install windows updates from the command-line? The graphical update tool doesn’t seem to work so well in Windows 7. Sometimes it does, sometimes it doesn’t. My problem is that I can’t see any updates when I click to see the details list. So when there are updates that are not checked off by default, I can’t install them.

So, is there an other way I can get those installed?

6 Answers 6

Not sure about Windows 7, but with XP/Vista, you could run the following command to detect and download updates:

If you have issues getting it to work, check out the WSUS Wiki.

Otherwise if you have a specific update that you want, just download from the Microsoft website. If there’s some problem preventing you from installing, that’s the best way to find out, because the Windows Update logs are godawful to deal with.

You can use a script to check for, download and install updates synchronously. I often use a modified version of this vbscript for manual patching of Windows Core servers.

It seems to work like a charm for that but I’ve not tested it under Windows 7 of course. There is also a link to another article for targeting a specific update if needed.

There’s also a Powershell module that exposes a similar experience.

After a quick look I also found this third party application that also uses the update API, but with some more options (though requiring you to trust third party code).

Windows Update from Command Line:

The tool (Updates Deployment Commander) can do just what you are asking for. You can also pass parameters to avoid certain patches, target specific updates, reboot N minutes after completing, create reports in CSV, and so on.. It comes with a couple of GUI utilities too.

If you have to patch Windows operating systems, especailly after fresh installs, take a serious look at Offline Updater.

It uses scripts to download all the patches you suggest (so Win2000, Win XP, Win 2003, Vista, Win2008, Win2012 32 and 64 bit where appropriate), multi language, service packs, .NET frameworks, and Office patches (XP, 2000, 2003, 2007).

Once you have them all downloaded, you just update every patch Tuesday, and get only the changes. Though it does get the catalouges and they are getting longer every day (many megs now per OS/Office rev).

Once you have the files on your local machine downloaded, there is a script to make CD/DVD images of them (it will this automatically for DVD images per OS now if you would like).

What I do is use a 4GB SD memory card, in an SD card reader that honours the write protect tab. I used to use 2GB cards, but I can just barely fit Win XP and most of the Office builds on it now, so I moved on to 4GB cards.

Thus when troubleshooting a machine, I trust inserting this formerly writable device into a untrusted, possibly virus infected machine (since I know nothing about it, I assume it is infected) knowing my device is write protected.

Thus I can patch it up to date as a first step.

If you use the autorun, or launch the executable on the device (key, external HD, CD, DVD, wherever you wrote it) it starts a script that uses the Windows Update service on the local machine to apply all the updates, but instead of going across the wire to download them it just uses the local copy.

Thus it may still take 1+ hours to update a WinXP machine to the latest SP and patches, but there is zero network traffic along the way, and you can do it with the Ethernet cable unplugged entirely.

Amazingly useful tool!

Should not run afoul of Microsoft, like the AutoUpdate guys were, who were pre building a patch CD, that distributed the CD image. This tool updates scripts, and you have to go get all the patches on your licensed Windows workstation.

Читайте также:  Метро интерфейс для windows 10
Оцените статью