-
Home
-
News
- How to Install Windows Updates with DISM Command? [Full Guide]
By Ariel | Follow |
Last Updated
Sometimes you may fail to install Windows updates using a regular method. Is there a different way to install Windows updates? In this post, Partition Magic provides a complete guide on how to install Windows updates with DISM.
As we know, Microsoft releases security or cumulative updates regularly for Windows. It’s important to install Windows updates to improve Windows performance or solve some common bugs. Sometimes, however, you may encounter some errors when updating with a regular method, like 0xC1900101 – 0x40017, Windows updates not installing, insufficient space to install updates, etc.
So, I want to share a different way to install Windows updates. That is to update Windows using DISM commands. DISM is a command-line tool that’s often used to repair system files as well as update a running Windows OS. Here’s how to install Windows updates with DISM.
Before Your Do
Before you install Windows OS updates with DISM, make sure there is enough free space on your system partition. If not, you will fail to get the update. How to create enough free space for the Windows updates? You can delete some junk files or uninstall unneeded programs, but the process is time-consuming.
An effective method is to extend the C partition on Windows 10/11 using MiniTool Partition Wizard, which can quickly create enough space for the update. The tool can extend a partition to non-contiguous unallocated space and resize/move partitions. It’s worth having a try.
MiniTool Partition Wizard DemoClick to Download100%Clean & Safe
How to Install Windows Updates with DISM Command on Windows 11/10
This part will show you how to install Windows updates using DISM on Windows 10/11. Before starting, you need to visit the Microsoft Update Catalog site, download the Windows updates you need to install (e.g. KB5048652), and save the file on your PC.
Way 1. Install Windows Updates with DISM Using the MSU File
Once downloaded, you can directly use the “.msu” file to install Windows updates using DISM. Here are the detailed steps:
Step 1. Rename the download file name to KB5048652.msu.
Step 2. After renaming, move the KB5048652.msu file to the C:\ directory.
Step 3. Type cmd in the search box, right-click the Command Prompt and select Run as administrator. Then click on Yes to run the tool with admin rights.
Step 4. Type the following command and press Enter to wait for the Windows update to install successfully. Then reboot your computer.
DISM.exe /Online /Add-Package /PackagePath:C:\KB5048652.msu
Way 2. Install Windows Updates with DISM by Creating a Directory
If the above method can’t install Windows OS updates with DISM, you can try this method by creating a Cab directory in the C drive.
Step 1. Rename the file as we showed above, create a Temp folder in the C:\ directory, and create a Cab folder in the C:\Temp\ directory.
Step 2. Move the KB5048652.msu file into the C:\Temp\Cab directory.
Step 3. Type the following commands in order and press Enter after each one. Here you need to replace the KB update and 19045.5247 with your Windows OS builds.
- expand -F:* C:\Temp\KB5048652.msu C:\Temp\Cab
- DISM.exe /Online /Add-Package /PackagePath:C:\Temp\cab\SSU-19045.5247-x64.cab
- DISM.exe /Online /Add-Package /PackagePath:C:\Temp\cab\Windows10.0-KB5048652-x64.cab
Once done, you can restart the computer and see if the Windows update has been installed on your PC from the Settings window. However, this process may fail. How to fix it if you can’t install Windows updates with DISM? Let’s keep reading.
What to Do If You Can’t Install Windows Updates with DISM
There are some possible causes of the “Windows updates not installing with DISM” problem, such as network issues, corrupt system files, broken Windows update components, etc. To fix this problem, make sure your PC is connected to a stable network. Besides, you can repair system files using DISM.
Step 1. Open the elevated Command Prompt window as we showed above.
Step 2. Input the commands below in order and hit Enter after each one.
- DISM /Online /Cleanup-Image /CheckHealth
- DISM /Online /Cleanup-Image /ScanHealth
- DISM /Online /Cleanup-Image /RestoreHealth
Step 3. Once repaired, install Windows OS updates with DISM again and see if it works. If not, you can try running Windows Update troubleshooter, restarting the BITS service, or resetting Windows Update Components.
Wrapping Things Up
Now, I believe you know how to update Windows using DISM command after reading the above information. Make sure your computer has enough free space to install the update. If not, you can extend the system drive using MiniTool Partition Wizard. Besides, you can try the recommended fixes if you can’t install Windows updates using DISM command.
About The Author
Position: Columnist
Ariel has been working as a highly professional computer-relevant technology editor at MiniTool for many years. She has a strong passion for researching all knowledge related to the computer’s disk, partition, and Windows OS. Up till now, she has finished thousands of articles covering a broad range of topics and helped lots of users fix various problems. She focuses on the fields of disk management, OS backup, and PDF editing and provides her readers with insightful and informative content.
If Windows Update can’t install a particular update (or isn’t working all), Microsoft’s DISM command provides a simple way to get Windows updates installed.
Windows’ built-in Deployment Image Servicing and Management (DISM) command, a.k.a. dism.exe, is something of a Swiss Army knife when it comes to working on Windows OS images. Among its many capabilities — such as adding optional Windows features and packages, taking image inventories, performing image cleanups, and more — DISM includes an /Add-Package
option. This option allows users to install Microsoft Catalog updates in .cab or .msu files to a targeted Windows image.
.cab is short for “Windows Cabinet,” a type of compressed file that stores data and instructions for Windows that can update device drivers, system files, and so forth. The .msu file extension is associated with the Microsoft Update Standalone Installer. Normally, this installer uses the Windows Update Agent API to install update packages. Both .cab and .msu files also work with the DISM command against Windows image files, which may be of types .wim, .esd, .ffu, or virtual hard disk files of type .vhd or .vhdx.
Note that .msu updates only work on offline images, while the more common .cab files may be applied to an online image to update a running Windows install.
Why use DISM instead of Windows Update?
Good question! Sometimes, DISM provides a way to install an update when Windows Update (WU) may be having issues. At times, Windows Update may simply refuse to work, or it may hang or crash on a particular update. DISM provides a handy way to install updates when WU itself may be unable to oblige.
Other reasons to use DISM instead of Windows images include:
- Managing Windows images for large-scale and/or remote deployments using Microsoft Intune, Windows Autopilot, or Systems Center Configuration Manager (SCCM).
- Slipstreaming drivers or updates into standard Windows images for customization and special deployments.
- As an alternative to user-driven updates from an in-house update server, perhaps during scheduled maintenance periods. Holiday weekends are popular for this kind of thing in large organizations, because they provide an extra day to fix unexpected problems or to roll back to the previous status quo if such problems can’t be fixed.
Where to get Windows Update files
The Microsoft Update Catalog is the most common source for update files of all types, including .cab and .msu. Generally, items are accessed by name (e.g., Realtek Audio Driver) or by Knowledge Base (KB) article number. Thus, for example, KB4023057 is an update that applies to editions of Windows 10 versions 1507 through 1803, intended to clean up and fix any issues with Windows Update that might prevent updates from being installed.
Figure 1 shows the Update Catalog with a portion of one page’s results for KB4023057. Click the Download button in the right-hand column for the version of the file that matches the target OS to get the update.
Ed Tittel/IDG Figure 1: The Microsoft Update Catalog with KB5023057 items on display. (Click image to enlarge it.)
It you click the Download button for the topmost 1803 item shown in Figure 1, a download window appears. This provides a link to a corresponding .cab file with an extremely long name: windows10.0-kb4023057-x64_58b2f8fd3da37d22fb99bd6aa6c3f69951e67429.cab
Notice that the name includes the Windows version (10.0), the KB number, bittedness (x64 means 64-bit), and a globally unique identifier (GUID), and it ends with the cabinet file (.cab) extension. That makes this item an excellent target for an update through the DISM command.
Figure 2 shows the download page for this chosen item:
Ed Tittel/IDG Figure 2: The download page for the 64-bit .cab for KB4023057, 64-bit, version 1803.
The DISM /Add-Package syntax
The DISM command is fully documented online in Microsoft Docs in the DISM Operating System Package… Servicing Command-Line Options pages. This is just a small part of the DISM Tools Reference, another online document worth bookmarking and exploring for those who work with (and on) Windows images.
The manual lays out the abstract syntax for the /Add-Package
option as follows:
Dism /Add-Package /PackagePath: [/IgnoreCheck] [/PreventPending]
A /PackagePath
can point to a single .cab or .msu file, a folder that contains a single expanded .cab file or a single .msu file, or a folder that contains multiple .cab or .msu files (you can’t mix the two types, however). If /PackagePath
points to a folder that contains one or more .cab or .msu files at its root, any subfolders will be likewise recursively checked for such files as well.
The /PreventPending
switch instructs DISM to skip installing the package if it, or the targeted Windows image, has any uncompleted actions still pending. This is intended to prevent operating on images that may not be complete or intact.
As already stated, you can add multiple packages within a single DISM command by including multiple .cab or .msu files in the directory that serves as input to the /PackagePath
option. Ordinarily, DISM will check each package to make sure it’s applicable to the targeted image. If a package will not apply to that image, DISM will issue an error message. The /IgnoreCheck
switch may be used to get DISM to run silently and skip the applicability check for each package.
DISM /Add-Package example
Let’s say I’m running a 32-bit instance of Windows 10 version 1803. If I wanted to apply KB4023057 to that running image, and the .cab file had been downloaded to the path D:Images
, Figure 3 shows what that command would look like in Command Prompt or PowerShell. But first, some important notes for clarity, understanding and brevity:
- DISM only works with administrative privileges, so you must be logged into an administrative account and opt for “run as administrator” for your command line environment.
- The
/Online
switch tells DISM to apply packages to the currently running Windows image. - I renamed the .cab file to KB4023057 so I could fit everything into a single line of text.
Figure 3 shows the example command in an administrative command prompt window.
Ed Tittel/IDG Figure 3: The proper syntax for DISM /Add-Package for a running Windows system. (Click image to enlarge it.)
To run the command in this format, you must be sure there are no WU transactions pending. The safest way to make sure this is true is to restart the system before running any DISM /Add-Package commands.
Working on offline images is something of a specialty exercise. Here, I’ll simply say that offline images represent images that may be “under construction” or that are maintained in an image library for deployment and/or customization for distribution to users at some kind of scale — maintaining images usually isn’t worth the extra work involved, unless you have at least dozens of users, if not hundreds or more, to whom those images will be served. For more information on using DISM /Add-Package with offline images, see this Microsoft Docs item “Add or Remove Packages Offline Using DISM.”
Common cases when DISM /Add-Package is worthwhile
In my own experience, I’ve used DISM /Add-Package
dozens if not hundreds of times. In nearly every such case, that use has been motivated by one of two sets of circumstances:
- Windows Update isn’t working properly, and I can’t download or install any updates.
- Some particular update hangs or crashes when I try to install it using WU.
In both of those cases, downloading the .cab file and using DISM /Add-Package will get the update installed successfully on a running Windows image.
If it doesn’t work, this usually indicates deeper problems with Windows. In those rare instances, I next turn to an in-place upgrade install (see my CW story “How to fix Windows 10 with an in-place upgrade install”). If that provides no relief, my companion story “How to repair Windows 10 (and 11) in 4 steps” should set things right.
Привет, друзья. В этой статье будем говорить о теме обновлений Windows – теме токсичной применимо к Windows 10. Напомню расклад ситуации. В Windows 7 и 8.1 в любых редакциях мы можем с помощью штатного функционала по своему желанию отключать обновления или настраивать альтернативный автоматическому их тип поставки. В Windows 10 штатной возможности полностью отказаться от обновлений нет, а альтернатива их отключению — это всего лишь возможность краткосрочного временного отложения. И только в редакциях, начиная с Pro, есть возможность на длительное время отложить установку обновлений, и то не всех, а только функциональных. На нашем сайте мы не единожды рассматривали реализуемые сторонним софтом способы отключения обновлений Windows 10, в этой же статье пойдём немного дальше и поговорим об альтернативных способах их внедрения в систему — без участия системного центра обновлений, с использованием сторонних программ.
Итак, друзья, у каждого из нас могут быть разные причины, чтобы отключить обновления Windows, будь это «Десятка» или более ранняя версия – экономия лимитного трафика, оптимизация производительности, необходимость сведения к минимуму служебных системных процессов, отказ от накопительных апдейтов в целях сохранения стабильности и т.п. Но рано или поздно вопрос с установкой обновлений придётся решать, как минимум из соображений безопасности. Вы можете отключить системные обновления, а потом, когда у вас появится время и желание, включить их и комплексно внедрить. Для этого вам нужно просто запустить автоматическую работу центра обновления Windows. Но вы можете не связываться с последним и прибегнуть к помощи сторонних программ для внедрения обновлений Windows. Такие обычно более эффективны, работают быстрее центра обновления Windows, не нагружают ресурсы компьютера. А главное — предлагают нам полностью подконтрольный процесс установки обновлений, в частности с возможностью выполнения этого процесса в ручном режиме. Такие программы предлагают не только установку, но и возможность удаления обновлений, если те повлекли за собой проблемы в работе Windows. Рассмотрим тройку таких программ.
Бесплатная портативная утилита WAU Manager – это настраиваемый менеджер обновлений Windows, который может полностью заменить реализуемый штатно механизм установки обновлений. WAU Manager являет собой полноценную альтернативу центру обновления Windows: утилита может в автоматическом и ручном режиме устанавливать обновления, а также удалять уже установленные.
Первое, что нам нужно сделать – это отключить системный механизм обновлений. Активируем первую галочку в окне утилиты, применяем изменения кнопкой «Save and Apply» и перезагружаем компьютер.
Далее нам нужно выбрать режим поставки обновлений утилитой WAU Manager:
-
Normal – нормальный режим, при котором происходит автоматический поиск обновлений, но они не загружаются и не устанавливаются. Загрузку и установку мы производим вручную;
-
Passive — пассивный режим, при котором происходит автоматический поиск, загрузка и установка обновлений, и мы видим прогресс этих процессов;
-
Quiet – тихий режим, при котором происходит автоматический поиск, загрузка и установка обновлений, и мы видим только уведомления об этих процессах.
Ниже можем выбрать типы обновлений:
-
Driver updates — только драйверы;
-
Software updates – только ПО;
-
Both – и драйверы, и ПО.
Ну и кому нравится, когда компьютер без предупреждения вырубается для перезагрузки после обновления в самый не походящий для этого момент, может активировать галочку «Automatically reboot if needed». При любом внесении изменений применяем их кнопкой «Save and Apply».
Я оставляю все установки по умолчанию – нормальный режим и поиск типов обновлений как драйверов, так и ПО. И буду работать с установкой обновлений вручную. Жму кнопку «Update Windows Now».
Все найденные обновления отмечены галочками для установки. Если что-то из найденного мы не хотим устанавливать, просто снимаем галочку этого обновления. Далее жмём «Install checked».
Ожидаем завершения установки.
При необходимости перезагрузки в таком вот окошке утилиты можем выбрать:
-
Remind me in – не перезагружаться сейчас, но напомнить об этом через указанное время, при этом далее следует нажать кнопку «Postpone»;
-
Reboot now – перезагрузиться прямо сейчас;
-
Dismiss – просто отменяем перезагрузку и перезагружаемся, когда нам заблагорассудится.
В нижнем блоке нам предлагаются ещё две функции:
-
Создание на рабочем столе ярлыка запуска поиска обновлений (в режиме Normal) или их автоматической установки (в режимах Passive и Quiet);
-
Планировщик установки обновлений.
При активации планировщика поиск, скачивание и установка обновлений будут происходит в автоматическом режиме. Но дату старта этой задачи и её периодику определяем мы в графах, соответственно, «Schedule starts at» и «Repeat every». Если какая-то из этих функций интересует, активируем её, настраиваем (в случае с планировщиком) и жмём кнопку «Save and Apply».
Чтобы удалить установленные обновления, в главном окне утилиты кликаем кнопку «Uninstall Updates».
Отмечаем галочками апдейты для удаления и жмём кнопку «Uninstall checked».
Утилита также позволяет скрывать обновления, которые нам не нужны, чтобы они впоследствии не путались в перечне с новыми. И может предложить очистку файлов установки уже установленных обновлений.
Update Manager for Windows – это сторонний менеджер управления обновлениями, с помощью которого можно их отключать, искать, скачивать, устанавливать в ручном режиме. Приложение являет собой незначительно изменённую реализацию другой утилиты Windows Update MiniTool, мы рассматривали её на страницах сайта. Она, увы, давно уже не обновлялась и в работе с обновлениями Windows 10 не эффективна в части их отключения. Собственно, в этой части и кроется основное отличие новой инкарнации утилиты. В Update Manager for Windows реализована дополнительная вкладка «Автообновление» с настройками блокировки автоматичного обновления.
Утилита существует в формате UWP-приложения для Windows 10, его можно бесплатно скачать в магазине Windows Store. Но в этом формате из-за отсутствия возможности запуска приложения с правами администратора мы не сможем воспользоваться функционалом отключения обновлений. Плюс, UWP-приложение не русифицировано. Я рекомендую использовать классическую реализацию утилиты (Win32) с GitHub.
Программа Dism++ не требует представления для постоянных читателей сайта, у нас о ней, о работе с ней написано множество статей. Dism++ — это графический интерфейс штатного консольного средства для работы с образами Windows Dism. И, как и последнее, программа Dism++ умеет работать с интеграцией обновлений Windows – как в текущий её образ, т.е. установленную на компьютере операционную систему, так и в образ Windows, установленной на другом диске компьютера. Более того, Dism++ — это редактор дистрибутива Windows, и с помощью программы обновления можно внедрять в установочные образы системы. В ручном режиме с помощью Dism++ можно проводить поиск обновлений, их внедрение в Windows, а также при необходимости удаление.
В окне программы на панели вверху кликаем нужную Windows, если их несколько стоит на компьютере. Идём в раздел «Обновления». Во вкладке «Windows Update» жмём кнопку «Анализ». Жмём, пока отобразится список доступных обновлений. Далее галочками отмечаем все их или только отдельные. И жмём «Установить».
Для удаления установленных обновлений переключаемся на вкладку «Установленные», отмечаем галочками ненужные обновления. И жмём «Удалить».
Примечательность программы Dism++ заключается, друзья, в том, что она присутствует в числе арсенала реанимационного LiveDisk’а by Sergei Strelec. Если после установки обновлений Windows и перезагрузки вместо её запуска будем лицезреть синий экран смерти, что, увы, иногда случается, можно будет загрузить компьютер с LiveDisk’а, открыть Dism++ и из перечня установленных обновлений удалить свежие. В числе которых будет и то, что повлекло за собой крах системы. И таким образом, возможно, можно будет восстановить работоспособность Windows.
Единственный нюанс: Dism++ не умеет отключать обновления Windows. Но для этих целей можно использовать бесплатные утилиты типа Win Updates Disabler или Wu10Man.
Portable Update – утилита для оффлайн-обновления Windows. Сама скачивает пакет обновлений с серверов Microsoft, сама определяет какие обновления нужны, и сама же их устанавливает. Детально о Portable Update.
Patchfluent – утилита для установки обновлений в Windows 10 и 11, являет собой альтернативу системному центру обновления в этих операционных системах. Детально о Patchfluent.
UpdateHub — современное приложение для Windows 10 и 11, предлагающее комплексное обновление программ, приложений и самой Windows. Детально о UpdateHub.
Обновления для операционной системы Windows выпускаются в виде файлов с расширением MSU или CAB. Если на компьютере не работает (отключена) служба Windows Update (Центр обновления Windows), вы можете скачать и установить накопительные обновления или обновления безопасности Windows вручную. В этой статье мы покажем, как скачать и установить в Windows обновления в формате MSU и CAB файлов.
Содержание:
- Как вручную скачать MSU файлы обновлений для Windows?
- Установка обновлений из MSU файлов в Windows
- Как извлечь CAB файл из MSU обновления?
- Установка CAB файла обновлений в Windows 10/11
- Установка CAB и MSU обновления с помощью скриптов
Как вручную скачать MSU файлы обновлений для Windows?
Microsoft выпускает обновления и патчи в формате CAB файла. Именно в таком виде ваш компьютер получает обновления с серверов обновлений Microsoft или локального сервера WSUS. Для более удобного ручного распространения отдельных обновлений клиентами через каталог обновлений Microsoft, такие CAB файлы упаковываются в специальный формат MSU (Microsoft Update Standalone Package).
Вы можете скачать MSU файлы обновлений Windows (а в некоторых случаях и CAB) и других продуктов MSFT можно в каталоге обновлений Microsoft (https://www.catalog.update.microsoft.com/). Перейдите в Microsoft Update Catalog, найдите и скачайте нужное обновление. К примеру, я хочу установить обновление стека 2022-05 Servicing Stack Update for Windows 10 Version 21H2 for x64-based Systems (KB5014032). Нажмите на кнопку Download.
Переместите скачанный файл ssu-19041.1704-x64_70e350118b85fdae082ab7fde8165a947341ba1a.msu в каталог C:\temp. Переименуйте файл на более короткое имя — windows10-21h2-kb5014032.msu.
Установка обновлений из MSU файлов в Windows
Для запуска установки пакета обновления в Windows достаточно дважды щёлкнуть по скачанному MSU файлу. Если обновление применимо к данному компьютеру, откроется диалоговое окно Автономного установщика обновлений Windows (Windows Update Standalone Installer), в котором нужно подтвердить установку апдейта.
При установке MSU обновления может появится ошибка “Обновление неприменимо к этому компьютеру”. Причины этой ошибки подробно разобраны в статье по ссылке.
Также вы можете установить msu пакет обновления из командной строки с помощью утилиты wusa.exe.
Для установки обновления в «тихом» режиме (пользователю не будут показываться никакие всплывающие окна) с отложенной перезагрузкой, откройте командную строку с правами администратора и выполните команду:
wusa.exe c:\Temp\windows10-21h2-kb5014032.msu /quiet /norestart
Через некоторое время проверьте, что обновление успешно установлено:
wmic qfe list | findstr 5014032
Или найдя в журнале событий Установка (Event Viewer -> Windows Logs -> Setup) запись с Event ID 2 от источника WUSA с текстом:
Windows update "Security Update for Windows (KB5014032)" was successfully installed. (Command line: "wusa.exe c:\Temp\windows10-21h2-kb5014032.msu /quiet /norestart ")
Обновление Windows "Security Update for Windows (KB5014032)" было успешно установлено. (Командная строка: C:\Windows\system32\wusa.exe c:\Temp\windows10-21h2-kb5014032.msu /quiet /norestart)
Обратите внимание, что установка обновлений в msu формате в Windows через wusa.exe выполняется медленнее, чем при установке того же обновления в виде cab файла. Причина в выполнении дополнительного сканирования на серверах Windows Update/WSUS. См статью о медленной установке msu обновлений.
Как извлечь CAB файл из MSU обновления?
Если служба Windows Update (wuausrv) работает некорректно, вы не сможете установить обновление из MSU файла. В этом случае можно вручную распаковать пакет MSU, извлечь из него CAB файл обновления и вручную установить его в Windows.
Чтобы распаковать MSU пакет в каталог C:\Temp\kb4056887 (каталог нужно предварительно создать), выполните следующую команду:
expand -f:* “C:\Temp\windows10.0-kb4056887-x64.msu” C:\Temp\kb4056887
Microsoft (R) File Expansion Utility Version 10.0.10011.16384 Copyright (c) Microsoft Corporation. All rights reserved. Adding C:\Temp\kb4056887\WSUSSCAN.cab to Extraction Queue Adding C:\Temp\kb4056887\Windows10.0-KB4056887-x64.cab to Extraction Queue Adding C:\Temp\kb4056887\Windows10.0-KB4056887-x64-pkgProperties.txt to Extraction Queue Adding C:\Temp\kb4056887\Windows10.0-KB4056887-x64.xml to Extraction Queue Expanding Files .... Expanding Files Complete ... 4 files total.
Как вы видите в каталоге появилось 4 типа файлов:
- .xml файл (Windows10.0-KB4056887-x64.xml) — содержит метаданные пакета msu и используется программой Wusa.exe
- .cab файл (Windows10.0-KB4056887-x64.cab — один или несколько) – непосредственно архив с обновлением Windows
- *pkgProperties.txt файл (Windows10.0-KB4056887-x64-pkgProperties.txt)– содержит свойства пакета (дата выпуска, архитектура, тип пакета, ссылка на KB и т.д.)
Также вы можете открыть любой MSU файла с помощью утилиты 7-ZIP и извлечь из него CAB файл.
Установка CAB файла обновлений в Windows 10/11
Вы можете установить CAB файл обновления в Windows двумя способами.
Наиболее универсальный способ установки обновления из CAB файл – утилита DISM.exe. Команда установки может быть такой:
DISM.exe /Online /Add-Package /PackagePath:c:\Temp\kb4056887\Windows10.0-KB4056887-x64.cab
Deployment Image Servicing and Management tool Version: 10.0.10240.16384 Image Version: 10.0.10240.16384 Processing 1 of 1 - Adding package Package_for_KB4056887~31bf3856ad364e35~amd64~~10.0.1.0 [==========================100.0%==========================] The operation completed successfully.
Примечание. Обратите внимание, как быстро происходит установка пакета через DISM по сравнению со скоростью установки обновления из MSU файла.
Если нужно установить CAB пакет в тихом режиме и подавить запрос на перезагрузку компьютера после установки обновления, команда DISM будет такой:
start /wait DISM.exe /Online /Add-Package /PackagePath: c:\Temp\kb4056887\Windows10.0-KB4056887-x64.cab /Quiet /NoRestart
Команда DISM.exe /Add-Package позволяет установить и MSU обновление (поддерживается только установка в офлайн образ Windows). Также вы можете в параметре
/PackagePath
указать путь к каталогу, в котором хранятся MSU и CAB файлы обновлений. DISM рекурсивно просканирует указанные каталог и вложенные папки и установит в образ Windows все найденные CAB и MSU пакеты.
Здесь нужно отметить, что команда DISM.exe /Add-Package не проверяет зависимости и требования к окружению при добавлении CAB файла в образ Windows (в отличии от wusa.exe которая предварительно проверяет, применимо ли MSU обновление к компьютеру.
Для установки CAB файлов в образ Windows вместо команды DISM /Add-Package можно использовать PowerShell командлет
Add-WindowsPackage -Online -PackagePath "C:\win10_kb123456.cab"
В Windows 8 и Windows 7 можно установить обновление с помощью менеджера пакетов Pkgmgr. Команда:
start /w Pkgmgr /ip /m:c:"c:\Temp\kb4056887\Windows-KB123456.cab"
Примечание. В Windows 10 / Windows Server 2016 менеджер пакетов PkgMgr.exe более не поддерживается. При его запуске появляется предупреждении о необходимости использовать для управления пакетами DISM.exe.
Note: The PkgMgr.exe has been deprecated. Please update your scripts to use dism.exe to extract, install, uninstall, configure and update features and packages for Windows.
Примечание. Обратите внимание, что языковые пакеты Windows (MUI) также распространяются в формате CAB. Однако не получиться использовать для их установки команду DISM. Вместо этого, для установки новых языков в систему нужно использовать отдельную утилиту lpksetup.exe.
Вы можете добавить в контекстное меню File Explorer контекстное меню для установки CAB файлов. Для этого добавьте следующие *.reg файл в реестр:
Windows Registry Editor Version 5.00 [-HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs] [HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs] @="Install" "HasLUAShield"="" [HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command] @="cmd /k dism /online /add-package /packagepath:\"%1\""
Теперь для установки CAB файла нужно выбрать пункт Install в контекстном меню.
Установка CAB и MSU обновления с помощью скриптов
Если вам нужно установить сразу несколько CAB или MSU обновлений на компьютере, вы можете использовать BAT и PowerShell скрипты. Благодаря таким скриптам вам не придется по ставить обновления вручную по одному.
Создайте на диске каталог с обновлениями и скопируйте в него все MSU файлы, которые нужно обновить. Теперь для установки всех обновлений из указанного каталога, достаточно запустить скрипт install_msu.bat:
Set Folder="C:\updates"
for %%f in (%Folder%\*.msu) do (
wusa.exe %%f /quiet /norestart
)
По аналогии можно использовать PowerShell скрипт для установки MSU обновлений из указанной папки:
$dir = (Get-Item -Path c:\temp -Verbose).FullName
Foreach($item in (ls $dir *.msu -Name))
{
echo $item
$item = $dir + "\" + $item
wusa $item /quiet /norestart | Out-Null
}
Данная инструкция по ручной установке накопительных (если вы не помните что это такое, прочитайте статью про новую модель обновлений Windows систем) и любых других обновлений Windows применима ко всем поддерживаемым версиям ОС: Windows 11/10/8.1 и Windows Server 2022/2019/2016/2012R2.
Windows 10 often fails to update and rather returns an error message with some code. When this happens, users tend to let go of the issue and perform unnecessary checks on their PCs. If you are also struggling with an update-related issue, and don’t know what to do next, you should simply download and install the recent cumulative update from Microsoft’s Update Catalog.
Usually, the catalog site offers updates in the form of .msu
file extension which is easy to install i.e. double-click on the setup file and the installation starts immediately afterward. However, what if the downloaded file bears a .cab extension? In this post, we will discuss the essential steps required to install Windows 10 cab updates using the DISM tool.
To install Windows 10 Cab updates, use the following steps –
- First of all, you need to download the Cab files (x86/X64).
- After the downloading completes, launch Command Prompt as an Administrator.
- On the elevated console, copy/paste the below code, and press Enter –
DISM.exe / Online / Add-Package / PackagePath: Pathofthecabfile
Note: Replace the “Pathofthecabfile
” with the actual cab file location. For instance, if you have placed the cab file under the root directory, use this path – C:\KB_number-x64.cab.
Alternatively, one may also open the folder containing the cab file. While holding the Shift key on your keyboard, right-click on this file and select “Copy as path” from the list of available options.
- Now that you have the right path, replace the “
Pathofthecabfile
” in the above command with your copied path. If you have followed this way, the code should see like the following –
DISM.exe / Online / Add-Package / PackagePath: "C: \ Users \ ProfileName \ Downloads \ KB_number-x64.cab"
- To let go of restarting your computer after applying this update, you may execute this command next –
/ NoRestart / quiet
Note: If you don’t run the above command, Windows will restart on its own after applying the update.
Error 87 while installing the Windows 10 cab updates
If you are getting an error 87 while applying the cab updates on your computer, check the following –
- Command Prompt must be running having Administrative privileges.
- The path location that you are providing should be correct.