{"id":2126,"date":"2022-01-18T02:13:03","date_gmt":"2022-01-18T00:13:03","guid":{"rendered":"https:\/\/itsimple.info\/?p=2126"},"modified":"2022-01-18T02:22:43","modified_gmt":"2022-01-18T00:22:43","slug":"how-to-use-dism-to-check-and-repair-windows-image-from-recovery-console","status":"publish","type":"post","link":"https:\/\/itsimple.info\/?p=2126","title":{"rendered":"How to use DISM to Check and Repair Windows Image from recovery console"},"content":{"rendered":"\n<p>Often there a situation of operating system failed to boot because of sudden power lost or unexpected reboot. in those cases you will need to fix the windows boot mechanism, I have wrote a post on how to fix boot in windows it can be found here :<\/p>\n\n\n\n<p class=\"has-vivid-cyan-blue-color has-text-color\"><strong><a rel=\"noreferrer noopener\" href=\"https:\/\/itsimple.info\/?p=1937\" target=\"_blank\">https:\/\/itsimple.info\/?p=1937  <\/a> <\/strong><\/p>\n\n\n\n<p>how ever in extreme cases you will need to check the operating system files as well. 2 tools allow to you aid SFC (System File Checker) &amp; DISM . the most common option is to run :<\/p>\n\n\n\n<p><code>SFC \/scannow<\/code><\/p>\n\n\n\n<p>This command will scan protected operating system and will try to fix them in case they are broken . command returns the error \u201c<em>Windows Resource Protection found corrupt files but was unable to fix some of them<\/em>\u201c, it is likely that the tool could not get the necessary files from the Windows Component Store. another option to run :<\/p>\n\n\n\n<p><code>sfc \/scannow \/offbootdir=C:\\ \/offwindir=C:\\Windows<\/code><\/p>\n\n\n\n<p>You can also repair single file<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sfc \/SCANFILE=C:\\Windows\\SysWow64\\explorer.exe<\/code><\/pre>\n\n\n\n<p><strong>Delete registry key for pending system repair<\/strong><\/p>\n\n\n\n<p><strong>Step 1<\/strong>. Type <strong>regedit<\/strong> and select it from the start menu.<\/p>\n\n\n\n<p><strong>Step 2. <\/strong>In the registry editor, navigate to the following key.<\/p>\n\n\n\n<p><strong>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RebootPending<\/strong><\/p>\n\n\n\n<p><strong>Step 3.<\/strong> Right-click <strong>RebootPending<\/strong> key and select<strong>Delete<\/strong> in the context menu.<\/p>\n\n\n\n<p><strong>Step 4. <\/strong>Exit this window and try SFC again.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SFC scannow not working system repair pending<\/h3>\n\n\n\n<p>You may also receive message: there is a system repair pending which requires reboot to complete. To fix it, you can try DISM RestoreHealth as mentioned above. If it does not work and you receive DISM doesn\u2019t support servicing Windows PE with \/Online option, you can try the following.<\/p>\n\n\n\n<p>Run another DISM command<\/p>\n\n\n\n<p><strong>Step 1.<\/strong> Open cmd at boot.<\/p>\n\n\n\n<p><strong>Step 2.<\/strong> Type the following command and hit Enter.<\/p>\n\n\n\n<p><strong>dism.exe \/image:c:\\ \/cleanup-image \/revertpendingactions<\/strong><\/p>\n\n\n\n<p>In cases you wont be able to run those command you can try fixing the system with DISM :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Dism \/Online \/Cleanup-Image \/CheckHealth\nDism \/Online \/Cleanup-Image \/ScanHealth\nDism \/Online \/Cleanup-Image \/RestoreHealth\n<\/pre>\n\n\n\n<p>The following errors can appear when running the DISM \/RestoreHealth command:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Error: 50: DISM does not support servicing Windows PE with the \/Online option<\/strong> \u2013 this means your DISM thinks you are using a WinPE image. To fix this, remove the registry key <code>HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\MiniNT<\/code>; (run regedit from the command prompt)<\/li><li><strong>DISM Error 87: <\/strong>make sure the DISM command is written correctly, make sure you are using the DISM version for your Windows version (usually when booting in WinPE\/ <a href=\"http:\/\/woshub.com\/restoring-windows-recovery-environment-winre-in-windows-10\/\">WinRE<\/a>).<\/li><\/ul>\n\n\n\n<p>You can run this with offline option and any source of operating system location :<\/p>\n\n\n\n<p><code>Dism \/image:C:\\ \/Cleanup-Image \/RestoreHealth \/Source:D:\\sources\\install.wim<\/code><\/p>\n\n\n\n<p>When D: is the installation disk<\/p>\n\n\n\n<p><strong>Tip. <\/strong>Here are some useful DISM parameters an administrator must know:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>DISM \/Add-Package<\/code> \u2013<a href=\"http:\/\/woshub.com\/manually-install-cab-msu-updates-windows\/\">install MSU\/CAB update files<\/a>, <a href=\"http:\/\/woshub.com\/integrate-windows-updates-into-windows-8-image\/\">integrate security updates into your Windows image<\/a>;<\/li><li><code>DISM \/Get-Drivers<\/code> \u2013 <a href=\"http:\/\/woshub.com\/how-to-remove-unused-drivers-from-driver-store\/\">get the list of installed drivers<\/a>;<\/li><li><code>DISM \/Add-Driver<\/code> \u2013&nbsp;<a href=\"http:\/\/woshub.com\/integrate-drivers-to-windows-install-media\/\">inject drivers to Windows installation image<\/a>;<\/li><li><code>DISM \/Add-Capability<\/code> \u2013 installing additional Windows features via Features on Demand (FoD). For example, <a href=\"http:\/\/woshub.com\/install-rsat-feature-windows-10-powershell\/\">RSAT<\/a>, <a href=\"http:\/\/woshub.com\/connect-to-windows-via-ssh\/\">OpenSSH server<\/a>, or <a href=\"http:\/\/woshub.com\/using-native-ssh-client-windows\/\">Windows SSH client<\/a>);<\/li><li><code>DISM \/Enable-Features<\/code> and <code>\/Disable-Features<\/code> \u2013 enabling and disabling Windows components (for example, the <a href=\"http:\/\/woshub.com\/how-to-disable-smb-1-0-in-windows-10-server-2016\/\">SMBv1 protocol<\/a>);<\/li><li><code>Dism.exe \/StartComponentCleanup<\/code> \u2013 <a href=\"http:\/\/woshub.com\/how-to-clean-up-and-compress-winsxs-folder-in-windows-8\/\">cleanup the Component Store<\/a> and remove old component versions (from the WinSxS folder);<\/li><li><code>Dism \/set-edition<\/code> \u2013 <a href=\"http:\/\/woshub.com\/how-to-upgrade-windows-server-2016-evaluation-to-full-version\/\">upgrading from the evaluation to full Windows version<\/a> without reinstalling.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"to-repair-an-image\">To repair an image<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Use the <strong>\/RestoreHealth<\/strong> argument to repair the image. For example, to repair an offline image using a mounted image as a repair source, at a command prompt, type the following command:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>Dism \/Image:C:\\offline \/Cleanup-Image \/RestoreHealth \/Source:c:\\test\\mount\\windows\n<\/code><\/pre>\n\n\n\n<p>Or to repair an online image using some of your own sources instead of Windows Update, type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Dism \/Online \/Cleanup-Image \/RestoreHealth \/Source:c:\\test\\mount\\windows \/LimitAccess\n<\/code><\/pre>\n\n\n\n<p>If you do not specify a <strong>\/Source<\/strong> for the repair files, the default location for Features on Demand is used. For more information, see <a href=\"https:\/\/docs.microsoft.com\/en-us\/previous-versions\/windows\/it-pro\/windows-8.1-and-8\/hh825020(v=win.10)\" data-type=\"URL\" data-id=\"https:\/\/docs.microsoft.com\/en-us\/previous-versions\/windows\/it-pro\/windows-8.1-and-8\/hh825020(v=win.10)\">Configure a Windows Repair Source<\/a>. If you specify more than one <strong>\/Source<\/strong>, the files are copied from the first location where they are found and the rest of the locations are ignored. You can use <strong>\/LimitAccess<\/strong> to prevent the DISM tool from using Windows Update as a repair source or as a backup repair source for online images.<\/p>\n\n\n\n<figure class=\"wp-block-pullquote is-style-solid-color\"><blockquote class=\"has-text-color has-vivid-green-cyan-color\"><p><strong>Good Luck<\/strong><\/p><\/blockquote><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Often there a situation of operating system failed to boot because of sudden power lost or unexpected reboot. in those cases you will need to fix the windows boot mechanism, I have wrote a post on how to fix boot in windows it can be found here : https:\/\/itsimple.info\/?p=1937 how ever in extreme cases you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,12,14,15],"tags":[],"class_list":["post-2126","post","type-post","status-publish","format-standard","hentry","category-operating-systems","category-tutorials","category-windows","category-windows-server"],"_links":{"self":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/2126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2126"}],"version-history":[{"count":0,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/2126\/revisions"}],"wp:attachment":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}