Howto repair Windows 10 with dism in offline mode

Discussion in 'Windows 10' started by Obelix, Aug 18, 2015.

  1. Obelix

    Obelix MDL Junior Member

    Oct 2, 2008
    80
    3
    0
    #1 Obelix, Aug 18, 2015
    Last edited by a moderator: Apr 20, 2017
    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
    Code:
    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
    Code:
    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
     
  2. agent268

    agent268 MDL Junior Member

    Feb 20, 2012
    92
    33
    0
    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:D:\temp
     
  3. Obelix

    Obelix MDL Junior Member

    Oct 2, 2008
    80
    3
    0
    @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.
     
  4. Lucas Rey

    Lucas Rey MDL Member

    Feb 16, 2010
    124
    32
    10
    Understood, but if you see inside the script or just read the posts in the thread, you'll discover the right sintax for dism /offline mode. That's why I point you to that thread. ;)
     
  5. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,389
    11,614
    240
    #6 murphy78, Aug 18, 2015
    Last edited by a moderator: Apr 20, 2017
    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:
    Code:
    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.
     
  6. Obelix

    Obelix MDL Junior Member

    Oct 2, 2008
    80
    3
    0
    #7 Obelix, Aug 19, 2015
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Thanks to all for replying.

    I converted the esd to wim, but get the application error i mentioned above. dism.oog :
    Code:
    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!
     
  7. MrMagic

    MrMagic MDL Guru

    Feb 13, 2012
    6,015
    4,148
    210
    #8 MrMagic, Aug 19, 2015
    Last edited by a moderator: Apr 20, 2017
    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
     
  8. Obelix

    Obelix MDL Junior Member

    Oct 2, 2008
    80
    3
    0
    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.
     
  9. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,389
    11,614
    240
    You can mount the wim and point it at the mounted windows directory.
     
  10. MrMagic

    MrMagic MDL Guru

    Feb 13, 2012
    6,015
    4,148
    210

    But it's not necessary?

    Basically asking if both methods work, mounting ISO vs mounting WIM
     
  11. Obelix

    Obelix MDL Junior Member

    Oct 2, 2008
    80
    3
    0
    #12 Obelix, Aug 19, 2015
    Last edited by a moderator: Apr 20, 2017
    (OP)
    i found this in the dism.log

    Code:
    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!!!!!!!

    Code:
    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
     
  12. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,389
    11,614
    240
    #13 murphy78, Aug 19, 2015
    Last edited by a moderator: Apr 20, 2017
    Yes both work.
    If you mount, you use something like:
    Code:
    dism /online /cleanup-image /restorehealth /source:c:\mount\windows
     
  13. Obelix

    Obelix MDL Junior Member

    Oct 2, 2008
    80
    3
    0
    Gave up. Reinstalled.

    Thanks to all, who tried to help.
     
  14. balubeto

    balubeto MDL Addicted

    Dec 22, 2009
    580
    10
    30
    #15 balubeto, Oct 30, 2015
    Last edited: Oct 30, 2015
    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...
  15. agent268

    agent268 MDL Junior Member

    Feb 20, 2012
    92
    33
    0
    That looks correct to me. I also wouldn't recommend bumping AND creating a separate thread on the same question.
     
  16. balubeto

    balubeto MDL Addicted

    Dec 22, 2009
    580
    10
    30
    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...
  17. agent268

    agent268 MDL Junior Member

    Feb 20, 2012
    92
    33
    0
    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.
     
  18. balubeto

    balubeto MDL Addicted

    Dec 22, 2009
    580
    10
    30
    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...
  19. agent268

    agent268 MDL Junior Member

    Feb 20, 2012
    92
    33
    0