Для проверки целостности системных файлов и восстановления поврежденных файлов (библиотек) компонентов в Windows (Windows Server) можно использовать команды SFC и DISM. Эти две утилиты могут быть крайне полезными, если операционная система Windows работает нестабильно, появляются ошибки при запуске стандартных приложений или служб, после вирусного заражения и т.д.
В этой статье мы рассмотрим, как использовать команды
sfc /scannow
,
DISM /Online /Cleanup-Image /RestoreHealth
или
Repair-WindowsImage -Online -RestoreHealth
для восстановления образа и системных фалов в Windows 10/11 и Windows Server 2022/2019/2016.
Содержание:
- SFC /scannow: восстановление системных файлов Windows
- Проверка целостности хранилища компонентов Windows с помощью DISM
- Восстановление образа Windows с помощью DISM /RestoreHealth
- DISM /Source: восстановление образа Windows с установочного диска
- Восстановление образа Windows с помощью PowerShell
- DISM: восстановление поврежденного хранилища компонентов, если Windows не загружается
SFC /scannow: восстановление системных файлов Windows
Перед тем, как восстанавливать образ Windows с помощью DISM, рекомендуется сначала попробовать проверить целостность системных файлов с помощью утилиты SFC (System File Checker). Команда
sfc /scannow
позволяет проверить целостность системных файлов Windows. Если какие-то системные файлы отсутствуют или повреждены, утилита SFC попробует восстановить их оригинальные копии из хранилища системных компонентов Windows (каталог C:\Windows\WinSxS).
Утилита SFC записывает все свои действия в лог-файл
windir%\logs\cbs\cbs.log
. Для всех записей, оставленных SFC в файле CBS.log проставлен тег [SR]. Чтобы выбрать из лога только записи, относящиеся к SFC, выполните команду:
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfc.txt"
Если команда sfc /scannow возвращает ошибку “
Программа защиты ресурсов Windows обнаружила повреждённые файлы, но не может восстановить некоторые из них / Windows Resource Protection found corrupt files but was unable to fix some of them
”, скорее всего утилита не смогла получить необходимые файла из хранилища компонентов (образа) Windows.
В этом случае вам нужно попробовать восстановить хранилище компонентов вашего образа Windows с помощью DISM.
После восстановления образа вы можете повторно использовать утилиту SFC для восстановления системных файлов.
Проверка целостности хранилища компонентов Windows с помощью DISM
Утилита DISM (Deployment Image Servicing and Management) доступна во всех версиях Windows, начиная с Vista.
Для сканирования образа Windows на наличие ошибок и их исправления используется параметр DISM /Cleanup-image. Команды DISM нужно запускать из командной строки, с правами администратора.
Чтобы проверить наличие признака повреждения хранилища компонентов в образе Windows (флаг CBS), выполните команду (не применимо к Windows 7/Server 2008R2):
DISM /Online /Cleanup-Image /CheckHealth
Эта команда не выполняет полное сканирование хранилища компонентов. Проверяются лишь записанные ранее маркеры повреждений и события в журнале Windows. Изменения в образ не вносятся. Команда проверит, не помечен ли ваш образ Windows как поврежденный и возможно ли исправить его.
В этом примере команда вернула, что с образом все хорошо:
No component store corruption detected. The operation completed successfully.
Чтобы выполнить полное сканирование хранилища компонентов на наличие повреждений в хранилище компонентов Windows, запустите команду:
DISM /Online /Cleanup-Image /ScanHealth
Команда проверки образа Windows может выполняться довольно долго (от 10 до 30 минут). И вернет один из трех результатов:
- No component store corruption detected – DISM не обнаружил повреждения в хранилище компонентов;
- The component store is repairable – DISM обнаружил ошибки в хранилище компонентов и может исправить их;
- The component store is not repairable – DISM не может исправить хранилище компонентов Windows (попробуйте использовать более новую версию DISM или вам придется восстанавливать образ Windows из резервной копии, сбрасывать или полностью переустанавливать вашу копию Windows.
В Windows 7 и Windows Server 2008 R2 для использования параметра DISM /ScanHealth нужно установить отдельное обновление KB2966583. Иначе при запуске DISM будет появляться “
Ошибка 87. Параметр ScanHealth не распознан в этом контексте
”.
Команда DISM /ScanHealth может вернуть ошибки:
- Ошибка: 1726. Сбой при удалённом вызове процедуры;
- Ошибка: 1910. Не найден указанный источник экспорта объекта.
Это однозначно говорит о том, что ваш образ Windows поврежден и его нужно восстановить.
Восстановление образа Windows с помощью DISM /RestoreHealth
Чтобы исправить повреждения в хранилище компонентов образа Windows нужно использовать опцию RestoreHealth команды DISM. Эта опция позволит исправить найденные в образе ошибки, автоматически скачать и заменить файлы повреждённых или отсутствующих компонентов эталонными версиями файлов из центра обновлений Windows (на компьютере должен быть доступ в Интернет). Выполните команду:
DISM /Online /Cleanup-Image /RestoreHealth
В Windows 7/2008 R2 эта команда выглядит по другому:
DISM.exe /Online /Cleanup-Image /ScanHealth
Процесс сканирования и восстановления компонентов может быть довольно длительным (30 минут или более). DISM автоматически загрузит недостающие или поврежденные файлы образа с серверов Windows Update.
Восстановление выполнено успешно. Операция успешно завершена.
The restore operation completed successfully.
DISM /Source: восстановление образа Windows с установочного диска
Если на компьютере (сервере) отсутствует доступ в Интернет или отключена/повреждена служба Windows Update (как восстановить клиент Windows Update), то при восстановлении хранилища компонентов появятся ошибки:
- 0x800f0906 — Не удалось скачать исходные файлы. Укажите расположение файлов, необходимых для восстановления компонента, с помощью параметра Источник (0x800f0906 — The source files could not be downloaded. Use the source option to specify the location of the files that are required to restore the feature);
- Ошибка: 0x800f0950 — Сбой DISM. Операция не выполнена (0x800f0950 — DISM failed. No operation was performed);
- Ошибка:0x800F081F. Не удалось найти исходные файлы. Укажите расположение файлов, необходимых для восстановления компонента, с помощью параметра Источник (Error 0x800f081f, The source files could not be found. Use the «Source» option to specify the location of the files that are required to restore the feature).
<
Во всех этих случаях вы можете использовать альтернативные средства получения оригинальных файлов хранилища компонентов. Это может быть:
- Установочный диск/флешка/iso образ Windows
- Смонтированный файл wim
- Папка \sources\SxS с установочного диска
- Файл install.wim с установочным образом Windows
Вы можете указать WIM или ESD файл с оригинальным установочным образом Windows, который нужно использовать в качестве источника для восстановления файлов системы. Предположим, вы смонтировали установочный ISO образ Windows 11 в виртуальный привод D:.
Примечание. Для восстановления поврежденных файлов в хранилище компонентов из локального источника версия и редакция Windows в образе должна полностью совпадать с вашей.
С помощью следующей PowerShell команды проверьте, какая версия Windows установлена на вашем компьютере:
Get-ComputerInfo |select WindowsProductName,WindowsEditionId,WindowsVersion, OSDisplayVersion
Выведите список доступных версий Windows в установочном образе:
Get-WindowsImage -ImagePath "D:\sources\install.wim"
В нашем случае образ Windows 11 Pro в образе install.wim имеет
ImageIndex = 6
.
Для восстановления хранилища компонентов из локального WIM/ESD файла с блокированием доступа в интернет, выполните следующую команду (не забудьте указать ваш индекс версии Windows в файле):
DISM /online /cleanup-image /restorehealth /source:WIM:D:\sources\install.wim:6 /limitaccess
Или:
DISM /online /cleanup-image /restorehealth /source:ESD:D:\sources\install.esd:6 /limitaccess
Если при запуске появляется
- Ошибка Error: 50: DISM does not support servicing Windows PE with the /Online option, значит ваша DISM считает, что вы используете WinPE образWindows. Чтобы исправить это, удалите ветку реестра HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\MiniNT.
Ошибка DISM Error 87: проверьте правильно написания команды, убедитесь что вы используете версию DISM для вашей версии Windows (обычно бывает при загрузке через WinPE/WinRE).
Утилита DISM пишет подробный журнал сканирования и восстановления системных файлов в файл
C:\Windows\Logs\DISM\dism.log
.
После восстановления хранилища компонентов вы можете запустить утилиту проверки системных файлов
sfc /scannow
. Скорее всего она успешно восстановит поврежденные файлы:
Программа защиты ресурсов Windows обнаружила поврежденные файлы и успешно их восстановила.
Windows Resource Protection found corrupt files and successfully repaired them.
Если все системные файлы целы, появится сообщение:
Windows Resource Protection did not find any integrity violations
Восстановление образа Windows с помощью PowerShell
В версии PowerShell в Windows 10/11 и Windows Server 2022/2019 есть аналоги рассмотренных выше команд DISM. Для сканирования хранилища компонентов и поиска повреждений в образе выполните:
Repair-WindowsImage -Online –ScanHealth
Если ошибок в хранилище компонентов не обнаружено, появится сообщение:
ImageHealth State: Healthy
Для запуска восстановления системных компонентов и файлов наберите:
Repair-WindowsImage -Online -RestoreHealth
При отсутствии доступа к интернету эта команда может зависнуть в процессе восстановления образа. Вы можете восстановить системные компоненты из локальной копии образа Windows в виде WIM/ESD файла, скопированного с установочного ISO образа Windows 10 (здесь также нужно указать индекс версии Windows в wim файле в качестве источника восстановления):
Repair-WindowsImage -Online -RestoreHealth -Source D:\sources\install.wim:5 –LimitAccess
DISM: восстановление поврежденного хранилища компонентов, если Windows не загружается
Если Windows не загружается корректно, вы можете выполнить проверку и исправление системных файлов в оффлайн режиме.
- Для этого загрузите компьютер с установочного образа Windows (проще всего создать загрузочную USB флешку с Windows 10/11 с помощью Media Creation Tool) и на экране начала установки нажмите
Shift + F10
- Чтобы разобраться с буквами дисков, назначенных в среде WinPE, выполните команду
diskpart
->
list vol
(в моем примере диску, на котором установлена Windows присвоена буква C:\, эту букву я буду использовать в следующих командах); - Проверим системные файлы и исправим поврежденные файлы командой:
sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows
- Для исправления хранилища компонентов используйте следующую команду (в качестве источника для восстановления компонентов мы используем WIM файл с установочным образом Windows 10, с которого мы загрузили компьютер):
Dism /image:C:\ /Cleanup-Image /RestoreHealth /Source:WIM:D:\sources\install.wim:6
- Если на целевом диске недостаточно места, то для извлечения временных файлов нам понадобится отдельный диск достаточного размера, например F:\, на котором нужно создать пустой каталог:
mkdir f:\scratch
и запустить восстановление хранилища компонентов командой:
Dism /image:C:\ /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim /ScratchDir:F:\scratch
Совет. Другие полезные команды DISM, которые должен знать администратор:
-
DISM /Add-Package
– установка MSU/CAB файлов обновлений, интеграция обновлений в образ Windows; -
DISM /Get-Drivers
– получение списка установленных драйверов; -
DISM /Add-Driver
– добавление драйверов в образ; -
DISM /Export-Driver
– экспорт установленных драйверов Windows; -
DISM /Add-Capability
– установка дополнительных компонентов Windows через Features on Demand (например, RSAT, сервер OpenSSH или ssh клиент Windows; -
DISM /Enable-Features
и
/Disable-Features
– включение и отключение компонентов Windows (например, протокола SMBv1), -
DISM /online /Cleanup-Image /StartComponentCleanup
– очистка хранилища компонентов и удаление старых версий компонентов (папки WinSxS); -
DISM /set-edition
– конвертирование ознакомительной редакции Windows на полную без переустановки.
Maintaining the integrity and reliability of your Windows operating system is crucial for ensuring a smooth computing experience. One of the powerful tools at your disposal for this purpose is the Deployment Imaging Service and Management Tool (DISM). This utility can help repair Windows system images, allowing users to fix problems not only with the operating system but also with the system image backups they create. In this article, we will explore what DISM is, how it operates, its commands, and the various ways to run DISM offline to repair Windows system image backups.
What is DISM?
DISM stands for Deployment Imaging Service and Management Tool. It’s a command-line utility included with Windows that is primarily used for servicing Windows images, both offline (from a non-running system image) and online (from the currently running system). DISM can be used to mount and service Windows images and to maximize the functionality of Windows through functionalities like driver injection, feature enabling, and provisioning.
The tool can manage Windows images in different formats, including Windows Imaging (WIM) files and virtual hard disks (VHD). DISM has become an essential part of the troubleshooting and recovery toolkit for system administrators and power users alike.
Understanding Windows System Image Backup
A system image is a complete snapshot of your Windows operating system, including the system settings, programs, and files. It allows you to restore your entire system to a previous state in case of severe issues like hard drive failures, malware infections, or any other catastrophic failures.
Creating a system image backup can be done through the built-in Windows Backup and Restore feature. Once created, it serves as a reliable fallback if something goes wrong. However, sometimes the image itself may become corrupted, rendering it useless when you most need it. This is where DISM comes into play, specifically when you need to repair such images.
Importance of Running DISM Offline
Running DISM offline is essential for several reasons:
-
Access to Corrupted Images: When the Windows system image is corrupted or damaged, running online commands will not be able to modify the image files. Thus, an offline approach is necessary for repairs.
-
Greater Control: Running DISM offline grants an advanced user greater control over what is being fixed. You can analyze and troubleshoot without risking further corruption to running services.
-
System Restoration: If you are preparing to restore the system from an image, running DISM offline can help ensure that the image is in good condition, reducing the risk of failures during restoration.
How to Run DISM Offline
To run DISM offline, you need access to the Windows Recovery Environment (WinRE) or have a bootable Windows installation media. Below are the methods you can use to run DISM offline to repair a Windows system image.
Method 1: Using Recovery Media
Prerequisites:
- A USB drive or DVD containing Windows installation media.
- Alternatively, you can use a bootable recovery drive created previously.
Steps:
-
Boot from Recovery Media:
- Insert the installation media into your computer and restart it.
- Access the boot menu (usually by pressing keys like F12, F10, or Esc) and select the appropriate boot device.
-
Access Command Prompt:
- Once the Windows Setup screen appears, select your language preferences and click «Next.»
- On the next screen, click «Repair your computer» in the lower-left corner.
- Select «Troubleshoot» and then «Advanced options.»
- Choose «Command Prompt.»
-
Identify the Mounted Image:
- In the Command Prompt, you may need to find the drive letter for the Windows image you want to repair. The drive letters can often differ from what you are used to. Use the command:
diskpart
Then type:
list volume
Identify the volume that contains the Windows installation and note the drive letter.
- In the Command Prompt, you may need to find the drive letter for the Windows image you want to repair. The drive letters can often differ from what you are used to. Use the command:
-
Run DISM Command:
- Exit
diskpart
by typingexit
and pressing Enter. - Now, use the DISM commands to repair the offline system image. Use the following command:
DISM /Image:E: /Cleanup-Image /RestoreHealth
Replace
E:
with the actual drive letter of your Windows image.
- Exit
-
Monitor the Process:
- DISM will begin scanning and repairing the image. This process may take some time, so be patient.
- Once complete, you should see a message indicating the operation was successful.
-
Exit and Reboot:
- Type
exit
to leave the Command Prompt and select «Continue» to restart your computer.
- Type
Method 2: Using Windows Recovery Environment
If you already have a Recovery Drive on your system:
Steps:
-
Access WinRE:
- If your system fails to boot multiple times, it may automatically enter the Windows Recovery Environment.
-
Open Command Prompt:
- Navigate through the «Troubleshoot» and «Advanced options» like in the previous section to open the Command Prompt.
-
Identify the Image:
- Use
diskpart
to locate the image as described earlier.
- Use
-
Run DISM Commands:
- Execute the DISM repair commands similar to the previous steps.
Method 3: Using a Windows PE Environment
Windows Preinstallation Environment (Windows PE) can also be used to load a minimal version of Windows and run DISM commands.
Steps:
-
Create Windows PE Environment:
- Use the Windows Assessment and Deployment Kit (Windows ADK) to create a Windows PE bootable USB drive.
-
Boot into Windows PE:
- Insert the USB drive and restart your computer, booting into the Windows PE environment.
-
Open Command Prompt:
- The system automatically boots into a Command Prompt.
-
Identify and Repair Image:
- Follow the earlier instructions to identify the correct drive letter, and run the DISM commands to repair the image.
Advanced DISM Command Options
While the basic command mentioned above can address many issues, DISM has several advanced parameters that can be extremely beneficial.
1. Check for Health
Before repairing, you can check the health of a Windows image using:
DISM /Image:E: /Cleanup-Image /CheckHealth
This command will quickly check whether the image has been flagged as corrupted.
2. Scan for Health
If you prefer a more thorough approach, you can scan for issues using:
DISM /Image:E: /Cleanup-Image /ScanHealth
This scans the image for corruption but does not perform repairs.
3. Use a Source for Repairs
If your image is severely corrupted, you can use a fresh Windows image or installation media as a source to fix issues:
DISM /Image:E: /Cleanup-Image /RestoreHealth /Source:F:sourcesinstall.wim
In this command, replace F:
with the appropriate drive letter pointing to the source significantly improving repair success chances.
Common Errors and Troubleshooting
DISM is reliable, but like any other tool, it can encounter errors. Here are some common DISM error codes and actions to resolve them:
ERROR 0x800f0906
This error typically indicates that DISM could not download necessary files. Ensure you have a stable network connection, especially if using online sources. Alternatively, provide a valid source for installation, as mentioned earlier.
ERROR 0x800f081f
This error suggests that DISM cannot find the files it needs. Again, using the /Source
switch will help in this scenario. Make sure to use a valid source.
ERROR 87
If you receive an «error 87» message, it means the command line syntax is incorrect. Ensure you are running the appropriate command without any typographical errors.
General Troubleshooting Tips
-
Validate Your Drive: Regularly check the health of your hard drive. Use
chkdsk
to identify and repair drive errors that could cause additional issues. -
Regularly Maintain Backups: Always maintain regular backups of your important files. If images are corrupted, you will appreciate having alternative recovery methods.
-
Update Your System Regularly: Ensure Windows Updates are applied timely to prevent common issues and maintain system image integrity.
Conclusion
Running DISM offline to repair Windows system image backups can be a lifesaver when your system encounters severe issues. With careful execution, you can restore image integrity, ensuring you have reliable images for recovery when needed. Whether using recovery media, WinRE, or Windows PE, understanding how to use DISM is essential for anyone looking to maintain the robustness of their Windows systems.
Remember, while DISM is a powerful tool, always approach system repairs with caution. Having proper backups and system recovery plans can mitigate risks and enhance your overall computing experience. As technology evolves, so too does our reliance on tools like DISM, ensuring that we have the capabilities to maintain our systems in a state of readiness and reliability.
Last Updated on January 17, 2025 by
When your Windows 10 system encounters issues such as corruption or missing files, performing a DISM offline repair can be an effective solution. This process uses the Deployment Image Servicing and Management (DISM) tool, which can help fix system problems that other tools might not resolve. Here’s a comprehensive guide to running a DISM offline repair on Windows 10.
Understanding DISM
DISM stands for Deployment Image Servicing and Management. It is a command-line tool provided by Microsoft for servicing and preparing Windows images, including the Windows Recovery Environment, Windows Setup, and Windows PE (WinPE).
The primary purpose of DISM is to repair and service Windows images. It can help fix issues such as corrupt system files and failed Windows updates.
Using DISM offline means running the tool when your system is not booted into the standard operating mode, also known as offline mode. This can be particularly useful when the operating system is too damaged to function properly.
Preparing for DISM Offline Repair
To perform an offline repair, you’ll need a USB flash drive or a DVD with the Windows 10 installation files. This media allows you to boot into a recovery environment and access the necessary tools.
Performing the DISM Offline Repair
Boot into Recovery Environment
- Boot your computer using the Windows 10 installation media.
- Access the command prompt by selecting “Repair your computer” > “Troubleshoot” > “Advanced options” > “Command Prompt”.
Use DISM Command
- Identify the drive letter assigned to your Windows installation. This is typically
C:
, but it may vary in the recovery environment. - Type the following command to check the health of your system image:
dism /image:C: /cleanup-image /scanhealth
ReplaceC:
with the appropriate drive letter if necessary. - To repair the image, use the following command:
dism /image:C: /cleanup-image /restorehealth /source:WIM:X:sourcesinstall.wim:1 /limitaccess
ReplaceX:
with the drive letter of your installation media.
Complete the Repair
- After the command completes, reboot your system. Your Windows 10 installation should now be repaired.
Additional Tips
After running the DISM tool, it’s a good practice to run the System File Checker (SFC) to ensure all system files are intact. You can do this by typing:
sfc /scannow
Using the ISO File
If you don’t have a physical installation media, you can mount an ISO file and use it as the source to repair the offline Windows 10 image.
Safe Mode
If you can boot into Windows 10 but still face issues, you can also try running the DISM tool in Safe Mode.
FAQ: Service Win10
Q: How can I repair Windows 10 using DISM offline?
To repair Windows 10 using DISM offline, you can use the DISM (Deployment Imaging Service and Management Tool) to fix system image issues. This process involves using a known good image file, like install.wim, from a Win10 installation media. Follow these steps to perform an offline repair:
- Create a bootable USB drive or use Windows installation media.
- Boot your computer using the installation media.
- Open Command Prompt in WinRE (Windows Recovery Environment) or WinPE (Windows Preinstallation Environment).
- Execute the following command to specify the location of the install.wim file and repair the image:
dism /Image:C: /Cleanup-Image /RestoreHealth /Source:X:sourcesinstall.wim /LimitAccess
Replace C:
with the drive letter where Windows is installed, and X:
with the drive letter of the installation media. This process may take several minutes.
Q: What is the purpose of using DISM offline repair in Windows 10?
The purpose of using DISM offline repair in Windows 10 is to fix issues related to the system image when the operating system is unable to boot or when running DISM in online mode fails. This method is useful for repairing corrupted or missing files using a known good source like an install.wim file from the installation media. It’s particularly helpful in scenarios where the Windows OS is severely damaged or corrupted, necessitating an offline windows repair.
Q: What tools are required to perform a DISM offline repair for Windows 10?
To perform a DISM offline repair for Windows 10, you will need the following tools:
- A bootable USB drive or Windows installation media is essential to repair offline windows.
- The install.wim file from the Windows 10 ISO or installation media.
- Access to the Command Prompt in WinRE or WinPE.
- The DISM tool, which is built into Windows.
These tools allow you to execute the necessary commands to repair the Windows image even when the system is unable to boot normally, and to repair offline windows.
Q: What should you do if DISM offline repair fails to repair Windows 10?
If DISM offline repair fails to repair Windows 10, consider the following steps:
- Verify the integrity of the install.wim file and ensure it’s not corrupted.
- Try using another known good image from a different installation media.
- Run the repair process using DISM offline repair.
sfc /scannow
command in WinRE to check and repair system files. - If the issue persists, consider performing a system restore or reinstalling Windows.
- Seek technical support if you’re unable to resolve the issue with the DISM and SFC tools.
These steps can help address scenarios where the DISM tool is unable to repair the corrupted Windows image, especially in offline windows situations.
Q: Can you use DISM offline repair to fix issues on Windows 11 as well?
Yes, you can use DISM offline repair to fix issues on Windows 11 as well. The process is similar to that for Windows 10. You’ll need a Windows 11 installation media and the install.wim file to perform the offline repair. The commands and steps are nearly identical, making DISM a versatile tool for repairing both Windows 10 and Windows 11 systems.
-
Hi,
i installed uxstyle, which renders my system unusable (flickering screen, even in safe mode). I am aware of the possiblity to reinstall my system, but i want to try repair it first.
So i did some research and found out, that some files are patched in a way, that sfc can’t restore easily. So i have to repair the «image», first. This could be done by
Dism.exe /online /Cleanup-Image /StartComponentCleanup
But i need the command for offline use, when i boot from Windows 10 USB installation thumb drive.
i tried
dism /cleanup-image /StartComponentCleanup /scratchdir:d:\temp /image:c:\ /source:f:\sources\install.esd dism /cleanup-image /StartComponentCleanup /scratchdir:d:\temp /image:c:\ /source:esd:f:\sources\install.esd dism /cleanup-image /StartComponentCleanup /scratchdir:d:\temp /image:c:\ /source:esd:f:\sources\install.esd:1
But i always get an error 87.
How to use dism from installation media?
Thanks
Obelix -
You are looking at the wrong switch. /restorehealth is what you want and you have things in the wrong order.
Dism /image:c:\ /Cleanup-Image /RestoreHealth /Source:esd:f:\sources\install.esd:1 /limitaccess /scratchdir:\temp
-
-
@agent268
I got an dismhost.exe exception 0xc0000420 at 20%, even after reboot.@lucas
The script is supposed to work on systems that boot normally, but mine doesn’t. I can’t even connect to the remote desktop. mstsc flashes like the monitor and closes immediately. -
use an image with an install.wim or you’d need to export that install.esd to a different install.wim file.
Normal command for offline would be:dism /image:c:\ /cleanup-image /restorehealth /source:wim:X:\sources\install.wim:1
where X is drive letter containing install.wim and 1 is index number containing the correct file.
-
Thanks to all for replying.
I converted the esd to wim, but get the application error i mentioned above. dism.oog :
2015-08-19 09:55:54, Error CSI 0000000a@2015/8/19:08:55:54.409 (F) base\wcp\componentstore\corruptionrepair.cpp(1830): Error STATUS_INTERNAL_ERROR originated in function ComponentStore::CRawStoreLayout::ReplaceFileW expression: Disposition == DecompressFile_Disposition::Decompressed [gle=0x80004005] 2015-08-19 09:55:54, Info CBS Added X:\windows\Logs\DISM\dism.log to WER report. 2015-08-19 09:55:54, Info CBS Not able to add current session file to offline WER report. [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND] 2015-08-19 09:55:54, Info CBS Not able to add pending.xml to offline WER report. [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND] 2015-08-19 09:55:54, Info CBS Failed to submit the Windows Error Report. [HRESULT = 0x8007053d - ERROR_SERVER_DISABLED] 2015-08-19 09:57:01, Error DISM DISM.EXE: DISM Package Manager processed the command line but failed. HRESULT=800706BE 2015-08-19 09:57:01, Error DISM DISM Manager: PID=1596 TID=1612 Failed to get the IDismImage instance from the image session - CDISMManager::CloseImageSession(hr:0x800706ba) 2015-08-19 09:57:01, Error DISM DISM.EXE: - CDismWrapper::CloseSession(hr:0x800706ba)
It’s a shame that MS disabled «system restore points» by default!
-
When I first had to do an offline dism, I read that the .WIM had to be mounted, is that not true?
I’ve done it with just mounting the ISO and adding the path to install.wim and it said it worked also
-
I mounted the wim, but didn’t helped. The error is the same. It seems to me, that dism 10.0.10240.16384 has a bug.
-
You can mount the wim and point it at the mounted windows directory.
-
But it’s not necessary?
Basically asking if both methods work, mounting ISO vs mounting WIM
-
i found this in the dism.log
2015-08-19 13:53:57, Error CBS Cannot add wim: file source because it is not supported during offline servicing [HRESULT = 0x800f082e - CBS_E_NOT_ALLOWED_OFFLINE]
I mounted the wim, but it still fails….. WTF!!!!!!!
2015-08-19 14:28:05, Error CSI 00000008 (F) Failed on regenerating file [l:18{9}]"ntdll.dll"[gle=0x80004005] 2015-08-19 14:28:05, Error CSI 00000009@2015/8/19:12:28:05.862 (F) base\wcp\componentstore\corruptionrepair.cpp(1830): Error STATUS_INTERNAL_ERROR originated in function ComponentStore::CRawStoreLayout::ReplaceFileW expression: Disposition == DecompressFile_Disposition::Decompressed
-
Yes both work.
If you mount, you use something like:dism /online /cleanup-image /restorehealth /source:c:\mount\windows
-
Gave up. Reinstalled.
Thanks to all, who tried to help.
-
Hi
If, from the «Command prompt» window of a DVD of Windows 10, I had to run the Dism /Image:<Offline_image_primary_partition_letter>:\ /Cleanup-Image /RestoreHealth /Source:wim:<DVD_drive_letter>:\Sources\Install.wim:<Image_Index> /limitaccess or Dism /Image:<Offline_image_primary_partition_letter>:\ /Cleanup-Image /RestoreHealth /Source:esd:<DVD_drive_letter>:\Sources\Install.esd:<Image_Index> /limitaccess command, I could also repair the Windows component store of the offline image?
Thanks
Bye
Stop hovering to collapse…
Click to collapse…
Hover to expand…
Click to expand…
-
That looks correct to me. I also wouldn’t recommend bumping AND creating a separate thread on the same question.
-
So, these commands can replace the sfc /scannow /offbootdir=<Offline_image_System Reserved_partition_letter>:\ /offwindir=<Offline_image_primary_partition_letter>:\windows command?
Thanks
Bye
Stop hovering to collapse…
Click to collapse…
Hover to expand…
Click to expand…
-
No. DISM doesn’t replace SFC. In the DISM command you posted, that repairs damage or corruption found to the Windows Component Based Servicing registry AND the Component Based Servicing Store (WinSxS). SFC will repair damaged, corrupted, or missing critical OS files that are protected by the OS. SFC actually uses the pieces of Windows Component Based Servicing to facilitate the repair process.
I want to say this question has come up a few times on MDL in the past, so I would recommend doing a little research and utilizing the Search feature too in order to learn more. If you still have questions after that, ask away.
-
Since you are an expert could you explain what are the Windows Component Based Servicing registry AND the Component Based Servicing Store (WinSxS)?
Thanks
Bye
Stop hovering to collapse…
Click to collapse…
Hover to expand…
Click to expand…
-
Home
-
News
- Detailed Tutorials on DISM Offline Repair Windows 10
By Tina |
Last Updated
How to use the Dism offline repair Windows 10 to repair Windows 10 image? How to use the DISM commands? This post from MiniTool will show you the detailed tutorials. In addition, you can visit MiniTool to find more Windows tips and solutions.
What Is DISM?
DISM, whose full name is Deployment Image Servicing and Management, is a Windows built-in tool for network administrators to prepare, modify and repair system image, including Windows Recovery Environment, Windows Setup, and Win PE. The DISM tool often is used to fix common problems with your computer’s hidden recovery image.
Usually, DISM will download necessary files from Windows Update to replace the bad files. Sometimes, DISM may fail to repair the corrupted image. In this case, you can try the DISM offline repair tool.
So, do you know how to use the DISM offline repair Windows 10? So, in the following section, we will show you how to run DISM command and how to use the DISM offline repair Windows 10.
How to Use DISM Offline Repair Windows 10?
In order to restore the offline image successfully, you need to do the following things first.
- First, please copy the install.win file from either another computer, a Windows 10 installation media, or the Windows 10 ISO files. This file is necessary during the repair process.
- Second, the install.wim file must be of the same version edition as well as language of the operating system you are using.
- Third, you need to confirm the location of the install.wim file.
- Fourth, DISM is case sensitive.
- Fifth, make sure the install.wim file is not read-only mode.
After ensuring the above settings, you can proceed on how to use the DISM offline repair Windows 10.
Now, here is the tutorial.
1. Right-click the ISO file and choose Mount.
2. Go to This PC and confirm the drive letter of the mounted file.
3. Then open Command Prompt as administrator.
4. Next, type the following commands one by one and hit Enter to continue.
DISM /Online /Cleanup-Image /StartComponentCleanup
DISM /Online /Cleanup-Image /AnalyzeComponentStore
DISM /Online /Cleanup-Image /RestoreHealth /source:F:\Sources\Install.wim:1 /LimitAccess (F refers to the driver letter of the mounted ISO file.)
After that, the DISM tool will start to repair Windows image with the known good files from install.wim file. And the above steps are on how to use the DISM offline repair Windows 10.
See what you can do if DISM /Online /Cleanup-image /Restorehealth is stuck.
Apart from using DISM offline repair Windows to repair Windows image files, you can also choose to use the DISM tool to check problems with the checkhealth option and scanhealth option.
Now, we will show you how to use the DISM command to check health.
How to Use DISM Command to Check Health?
In this part, we will show you how to use the DISM command to check health. To check health, you can use the checkhealth option and scanhealth option. Now, we will show them one by one.
Check Health with DISM Checkhealth Option
Now, here is the tutorial.
- Open Command Prompt as administrator.
- Then type the command DISM /Online /Cleanup-Image /CheckHealth and hit Enter to continue.
After the steps are finished, the DISM tool will run and verify any data corruption that requires fixing.
Check Health with DISM Scanhealth Option
You can also check health with DISM scanhealth option.
Now, here is the tutorial.
- Open Command Prompt as administrator.
- Then type the command DISM /Online /Cleanup-Image /ScanHealth and hit Enter to continue.
Then it will take several minutes to scan and determine whether there is a corrupted image needed to be repaired.
To sum up, this post has shown how to use DISM offline repair Windows 10 to repair corrupted images and also shown some DISM commands to check the health of the image. If you have some problems with DISM offline repair Windows 10, you can share it in the comment zone.
About The Author
Position: Columnist
Tina is a technology enthusiast and joined MiniTool in 2018. As an editor of MiniTool, she is keeping on sharing computer tips and providing reliable solutions, especially specializing in Windows and files backup and restore. Besides, she is expanding her knowledge and skills in data recovery, disk space optimizations, etc. On her spare time, Tina likes to watch movies, go shopping or chat with friends and enjoy her life.