Install windows updates with command line

Two Efficient Ways to Do Windows Update from Command Line [MiniTool Tips]

By Sonya | Follow | Last Updated November 27, 2020

  • Facebook
  • Twitter
  • Linkedin
  • Reddit

Summary :

Do you want to update Windows? Maybe you can try Windows update Command Line. But before you upgrade Windows, you had better back up your operating system with MiniTool software. Of course, there are other methods for Windows update offered in this article.

Quick Navigation :

Why Do You Need to Update Window?

Every year, Microsoft makes several updates to Windows. Especially Windows 10 has twice security updates every year. You may feel that Windows is so annoying to update so frequently, and you plan to ignore it, however, the risk to your computer will increase.

Most of the updates to Windows are designed to handle security issues. Security is the most important thing for you, because if the security is not enough, your computer can be easily attacked by malware or exploited by hackers.

By patching and improving vulnerabilities in the use of Windows, Microsoft adds new features in Windows Defender and Essentials program to resist malware and enhances Office security.

In addition to improving Windows security, Microsoft will also upgrade the existed programs or add new features to Windows, for example, the Cortana.

When Do You Need to Run Windows Update Command Line?

With the release of Windows 10, Windows is now available as a service rather than a product, so Windows Update on Windows 10 is turned on by default, and you can’t disable it, which is one of the highlights of Windows 10.

But sometimes there may be some problems with your computer, causing your Windows 10 not to update automatically. Therefore, you can run Windows update from Command Line.

What to Do Before Updating Windows from Command Line

Before running Windows update Command Line, the most important thing you need to do is to back up your operating system.

Some people will encounter some problems in reinstalling the system, causing the reinstallation system to fail. Similarly, some people will fail to upgrade Windows. The upgrade failure is likely to cause data loss, system file corruption, and so on.

So in order to avoid the system corruption caused by the upgrade failure or the computer cannot start, you can back up the system to another hard drive in advance or make a bootable external hard drive.

But how to back up the operating system to another hard drive quickly and safely? Here I’m going to introduce a piece of professional and powerful backup software – MiniTool ShadowMaker.

You can back up the operating system, disk and partition, files and folders. And then you can restore them when you need them. Besides, you can also sync files and folders using the software to avoid data loss as much as possible. It also enables you clone disks, even simple volumes on dynamic disks.

And the best thing about this piece of software is that you can use it for free for 30 days, so why not download it and have a try.

And now I will show you how to use MiniTool ShadowMaker to back up the operating system step by step.

Step 1: Launch MiniTool ShadowMaker at first, then choose Local or Remote to get the main interface by clicking Connect.

Step 2: Click SET UP BACKUP in the Home page if you haven’t performed the backup task with this software or go to the Backup directly. MiniTool ShadowMaker backs up the operating system and selects Destination by default. But if you want to change the destination, just click Destination.

Читайте также:  Как создать мультизагрузочный диск для windows

Step 3: As you can see, MiniTool ShadowMaker supports you to back up your data to five different destinations. You can choose the destination you want to save the backups, and then click OK to continue. It is recommended to choose an external hard drive.

There are three buttons under the Backup page which is very useful for you.

  • Schedule: You can set automatic backup here to avoid losing data by forgetting to back up when you are using your computer.
  • Scheme: You can manage the space occupied by the backed up files by deleting the specified backup image file versions here.
  • Options: You can set some advanced parameters here, such as setting encryption mode, shutting down after successful backup, adding comments to backup data, etc.

Step 4: If you have confirmed the backup source and backup destination, then click Back up Now.

Then after MiniTool ShadowMaker has backed up your operating system successfully, you can run Windows update Command Line.

After backing up your operating system, I highly recommend you to create bootable media using MiniTool ShadowMaker in case that you cannot boot your computer because of Windows update failure.

Click Media Builder under Tools page after you have inserted USB flash drive or CD/DVD, then just follow the instructions to create bootable media.

How to Run Windows Update Command Line?

After keeping data safe, it is time to run Windows update from Command Line. Actually, there are two powerful tools to run Windows update Command Line. One is Windows update Windows PowerShell, another one is Windows update Command Prompt.

Now let’s get started with Windows PowerShell to update Windows.

Windows Update Windows PowerShell

You can update your Windows by using Windows PowerShell, and it only takes four steps to get it done.

PowerShell, as a task-based command-line shell and scripting language, is designed for system administration. In PowerShell, cmdlet, designed to perform specific operations, also typically perform administrative tasks.

The reason administrators can perform administrative tasks on local and remote Windows systems as well as WS-Management and CIM is that PowerShell provides full access to COM and WMI.

Windows PowerShell can execute four kinds of named commands: cmdlets (.NET Framework programs designed to interact with PowerShell), PowerShell scripts (suffixed with .ps1), PowerShell functions, and stand-alone executable programs. PowerShell also provides an interactive command-line interface where you can enter commands and display their output.

Here’s how to update Windows with Windows PowerShell.

Step 1: Type powershell in the search box next Cortana, and right-click the top one, then choose Run as administrator and click Yes to continue.

Step 2: Enter Install-Module PSWindowsUpdate to install the Windows update module.

Step 3: Enter Get-WindowsUpdate to check for updates.

Step 4: Enter Install-WindowsUpdate to install the available updates.

After the four steps, you can update Windows using Windows PowerShell.

Windows Update Command Prompt

Except using Windows PowerShell to update Windows, you can also use Command Prompt to update Windows, which has existed for a long time on Windows operating system. But there is a limitation using this method: it will only show the results without showing any progress.

Command Prompt, as a command line interpreter application in most Windows operating systems, is used to execute typed commands. Through scripts and batch files, many commands automate tasks, and can perform advanced administrative functions.

So how to use Command Prompt to update Windows? It depends on which operating system you are using.

1. If your operating system is Windows 10, you can do the following instructions to update Windows.

Step 1: Type cmd in the search box next to Cortana, and right-click the top one, then choose Run as administrator and click Yes to continue.

Step 2: Type UsoClient StartScan to check for updates.

Step 3: Type UsoClient StartDownload to download updates.

Step 4: Type UsoClient StartInstall to install the download updates.

Step 5: Type UsoClient RestartDevice to restart your device after installing the updates.

Step 6: Type UsoClient ScanInstallWait to check, download and install updates.

Читайте также:  Аппаратные средства для linux

2. If you are using older versions’ operating system, you need to enter the following instructions in the Command Prompt window one by one.

Step 1: Enter wuauclt /detectnow to check for updates.

Step 2: Enter wuauclt /updatenow to start installing the detected updates.

Step 3: Enter wuauclt /detectnow /updatenow to check, download and install updates.

After doing these instructions step by step, you can update your Windows.

This article will tell you the things you need to do before upgrade to Windows 10. You need to make sure that you have done these things before upgrade.

Other Ways to Update Windows

There are two other different methods you can use to update Windows.

Use Windows Update Feature

Besides Windows update Command Line, you can also use the Windows Update feature to update Windows.

But how to use Windows Update to update Windows? The detailed instructions are below.

Step 1: Open Settings to choose Update & Security to continue.

Step 2: Choose Windows Update and click Check for updates to continue.

Step 3: After the Windows finds the available updates, click Restart now.

Then you just need to wait for the Windows to update. With this method, you can also update Windows.

Reinstall Windows

Actually, you can also reinstall Windows to perform Windows update. Let’s take Windows 10 as an example.

Before reinstalling Windows 10, you need to create installation media for reinstalling.

You’d better back up all the files in the computer you want to an external storage device or upload them to OneDrive or other Clouds to keep data safe.

Then download Windows 10 installation media to a single external hard drive with at least 8 GB available space.

And here is the way to reinstall Windows 10 using the installation media.

Step 1: Insert the installation media to your computer, and then open File Explorer to continue.

Step 2: Select the drive with the installation media and double-click on it to continue.

Step 3: Double-click setup.exe at first, and then click Yes to continue.

Step 4: Select one of the following options, and then click Next to continue.

  • Keep personal files and apps – This will preserve your personal data, apps, and settings.
  • Keep personal files only – This will preserve your personal data and settings, but all your apps will be removed.
  • Keep nothing – This will remove all personal data, settings, and apps.

Step 5: Click Install to start reinstalling Windows 10 on your computer.

Your computer will restart several times in the process of reinstallation.

Bottom Line

When you want to update your operating system, you should back up your operating system in advance to avoid data loss during the upgrade process. When upgrading Windows, you can use the Command Line to upgrade, or you can use other methods to upgrade Windows.

Finally, never ignore every update, because every update is for your computer to enhance your data protection.

If you have better advice or any confusion about this article, then you can leave a comment below or contact [email protected] .

Windows Update Command Line FAQ

  1. Press Win + I keys at the same time to open Settings, then click Update & Security.
  2. Click Windows Update and then click Check for updates in the right panel.
  3. If there are available updates, Windows will download it and install it automatically.
  • Facebook
  • Twitter
  • Linkedin
  • Reddit

ABOUT THE AUTHOR

Position: Columnist

Author Sonya has been engaged in editing for a long time and likes to share useful methods to get rid of the common problems of Windows computers, such as Windows Update error. And she aims to help more people to protect their data. What’s more, she offers some useful ways to convert audio and video file formats. By the way, she likes to travel, watch movies and listen to music.

Обновление билда Windows 10 из командной строки

Установщик setup.exe в дистрибутиве Windows 10 имеет довольно большой набор параметров командной строки, который может быть интересен администратором для автоматизации и управления обновлением билда (версии/сборки) Windows 10 на компьютерах пользователей с помощью SCCM и других инструментов. В этой статье мы покажем, как использовать параметры setup.exe при выполнении обновления и проверки совместимости с новым билдом Windows 10 .

Читайте также:  Возникла ошибка при запуске c windows system32 b2plib dll не найден указанный модуль

Параметры установщика Setup.exe в Windows 10

Для обновления билда Windows 10 используется программа установки Windows setup.exe. При обычном запуске setup.exe запускается графический мастер обновления Windows 10, однако у данной программы имеется большое количество параметров командной строки, которые можно использовать для автоматизации обновления ОС на компьютерах пользователей. Общий синтаксис и параметры Setup.exe перечислены ниже:

Подробную информацию об всех опциях setup.exe и их значениях для Windows 10 можно получить на странице документации: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-command-line-options

Генерация актуального ISO образа Windows 10

Чтобы выполнить обновление версии Windows 10б, вам нужно получить установочный ISO образ с последней версией Windows 10. На данный момент это Windows 10 1903.

Вы можете создать ISO образ с актуальной версией Windows 10 с помощью Media Creation Tool.

  1. Скачайте Media creation tool (https://www.microsoft.com/ru-ru/software-download/windows10);
  2. Запустите файл MediaCreationTool1903.exe и с помощью мастера укажите, что вы хотите “Создать установочный носитель (USB-устройство, флеш памяти, DVD-диск или ISO файл)”;
  3. Выберите язык, редакцию и архитектуру (x64 или x86) образа Windows 10, который вы хотите создать;
  4. Укажите, что вы хотите создать ISO-файл и укажите желаемое имя файла;
  5. И дождитесь, пока Media Creation Tool закончит загрузку установочного ISO образа Windows 10 на ваш локальный диск.

Распакуйте содержимое ISO образа на файловый сервер.

Проверка совместимости (возможности апгрейда) Windows 10

Перед апгрейдом версии Windows 10 вы можете проверить, возможно ли обновить ваш билд Windows 10 до версии, которая содержится в указанном образе. Для этого выполните команду:

start /wait setup.exe /Auto Upgrade /Quiet /NoReboot /DynamicUpdate Disable /Compat ScanOnly

  • /Auto Upgrade – автоматический режим обновления;
  • /Quiet – скрыть диалоговые окна мастера обновления;
  • /NoReboot – запретить перезагрузку компьютера;
  • /DynamicUpdate Disable — указывает, что не нужно загружать последние обновления через Windows Update;
  • /Compat ScanOnly – выполнить только проверку совместимости, без выполнения обновления.

Сканирование компьютера на совместимости с новый билдом Windows 10 займет некоторое время.

Вы можете отслеживать завершение процесса сканирования системы с помощью файла C:\$Windows.

BT\Sources\Panther\setupact.log. Сканирование завершено, если в файле содержится строка:

Результаты анализа на совместимость содержаться в файле C:\$Windows.

BT\Sources\Panther\setuperr.log. Найдите последнюю строку, которая выглядит так:

Это и есть код результата проверки.

Кроме того, вы можете получить код ошибки при проверке совместимости обновления из командной строки:

Например, команда вернула вам код -1047526896. Вам нужно с помощью калькулятора в режиме “Программист” вставить код ошибки в десятичном режиме (Dec). Чтобы получить шестнадцатеричный код ошибки, скопируйте значение из поля Hex, отбросив все F в начале и добавив в начало 0x. Например, в моем случае получился код 0xC1900210.

Наиболее распространение коды проверки совместимости ОС с новой версией Windows 10:

  • 0xC1900210 – проблем не найдено:
  • 0xC1900208 – выявлена проблема совместимости;
  • 0xC1900204 и 0xC190010E – невозможно автоматическое обновление (неверный редакция или архитектура Windows);
  • 0xC1900200 – компьютер не соответствует минимальным требования для Windows 10l
  • 0xC190020E – недостаточно места на диске;
  • 0xC1420127 – проблема при отключении WIM файла образа.

В моем случае в логе setuperr.log присутствовала ошибка:

Смотрим лог SetupDiagResults.log, который сформировала утилита SetupDiag. В логе указано, что есть две причины, которые мешают выполнить апгрейд Windows 10:

  • CompatBlockedApplicationAutoUninstall — найдено несовместимое приложение, которое нужно удалить перед апгрейдом версии.
  • FindAbruptDownlevelFailure — информация о последней ошибке, когда записи в журнале неожиданно обрываются.

При этом в конце журнала указано, что перед обновлением нужно удалить установленный антивирус McAfee.

При наличии SCCM вы можете централизованно собрать значения статуса errorlevel с компьютеров пользователей простым пакетом с командой setup.exe /Compat ScanOnly …. .

Автоматизация обновления версии Windows 10 из командной строки

Если вы не выявили проблем совместимости, которые мешают обновлению билда Windows 10, вы можете запустить обновление на компьютере с помощью простого скрипта. Создайте в сетевой папке с распакованным дистрибутивом Windows 10 простой bat файл run_win10_upgrade.bat со следующим кодом:

start /wait .\ W101903\Windows10x64-1903_ru\setup.exe /auto upgrade /DynamicUpdate disable /showoobe None /Telemetry Disable

Параметр /migratedrivers all – используется для принудительного переноса всех драйверов. Если параметр не задан, установщик сам принимает решения по каждому драйверу индивидуально.

Вы можете использовать другие опции setup.exe при обновлении Windows 10.

Начиная с Windows 10 1607 вы можете указывать параметры установки через файл Setupconfig.ini. Этот файл должен находится в каталоге с setup.exe и содержать примерно такой текст, аналогичный команде выше:

Для запуска обновления Windows 10 с помощью файла параметров используется команда:

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