sfc's scannow VS dism's scanhealth

Discussion in 'Windows 10' started by thessalonik, Aug 3, 2015.

Tags:
  1. thessalonik

    thessalonik MDL Senior Member

    Apr 7, 2014
    299
    16
    10
    Regarding these 2 commands:

    ========================================================
    dism.exe /online /cleanup-image /scanhealth
    dism.exe /online /cleanup-image /restorehealth
    ========================================================

    If first command reports that everything is fine and nothing is broken, there is no need for the second one.

    is those 2 commands adequate?

    and especially is there a neef for someone to run sfc /scannow?

    and if there is a need then please describe the difference between

    sfc /scannow
    and
    dism.exe /online /cleanup-image /scanhealth

    Detailed explanation would help a lot.

    Thank you all.
     
  2. thessalonik

    thessalonik MDL Senior Member

    Apr 7, 2014
    299
    16
    10
    #2 thessalonik, Aug 3, 2015
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Code:
    Windows PowerShell
    Copyright (C) 2015 Microsoft Corporation. All rights reserved.
    
    
    PS C:\Windows\system32> dism.exe /online /cleanup-image /scanhealth
    
    
    Deployment Image Servicing and Management tool
    Version: 10.0.10240.16384
    
    
    Image Version: 10.0.10240.16384
    
    
    [==========================100.0%==========================]
    No component store corruption detected.
    The operation completed successfully.
    PS C:\Windows\system32> sfc /scannow
    
    
    Beginning system scan.  This process will take some time.
    
    
    Beginning verification phase of system scan.
    Verification 100% complete.
    
    
    Windows Resource Protection found corrupt files and successfully repaired
    them. Details are included in the CBS.Log windir\Logs\CBS\CBS.log. For
    example C:\Windows\Logs\CBS\CBS.log. Note that logging is currently not
    supported in offline servicing scenarios.
    PS C:\Windows\system32>
    
    Just formatted and intalled Win10 yesterday.
    What the truth now?
    One says system clear and the other command states that sonme system files are corrupted.
     
  3. hbhb

    hbhb MDL Expert

    Dec 15, 2010
    1,017
    263
    60
    check cbs log, see what the sfc san has detected as corrupted. I find it best to run local sfc scan off a usb.
    here is the cmd
    Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:X:\sources\install.wim:1 /limitaccess

    X will be your usb drive letter.
     
  4. LastWords

    LastWords MDL Member

    Aug 29, 2013
    101
    127
    10
  5. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    16,198
    84,777
    340
    SFC check system directories (System32, SysWOW64, Fonts, ProgramData...)
    and most files in those directories are just hardlinks to WinSXS components
    when some files are detected currupted, SFC tries to recover from WinSXS\Backup (which is a standalone directory not hardlinked to any other)

    dism /cleanup-image checks WinSXS components store
     
  6. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340

    ... and if both fail, it's a good idea to check CBS.log for the actual error.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. thessalonik

    thessalonik MDL Senior Member

    Apr 7, 2014
    299
    16
    10

    Excuse my ignorance but i never heard of WinSXS components in the past. If you don't mind please elaborate on that too.


    Now back to SFC VS Dism:

    ========================================================
    Dism /Online /Cleanup-Image /ScanHealth
    Dism /Online /Cleanup-Image /RestoreHealth /Source:X:\Path_to_Windows.iso /LimitAccess
    ========================================================

    or

    ========================================================
    SFC /scannow
    Dism /Online /Cleanup-Image /RestoreHealth /Source:X:\Path_to_Windows.iso /LimitAccess
    ========================================================

    Which of the above too?



    And if i don't have windows image(.iso file) present then what would Dism use as an untouched repair source to correct my local broken installation? Windows Update perhaps? Microsoft Servers?
    Is it alwys the best idea to give it a local stored windows .iso file?
     
  8. Snuffy

    Snuffy MDL Expert

    Jan 7, 2008
    1,262
    626
    60
    SFC /scannow should be ran last... if you still have errors with SFC then
    use install media an upgrade 10240 will upgrade it self to fix CORRUPTED System Files.
     
  9. thessalonik

    thessalonik MDL Senior Member

    Apr 7, 2014
    299
    16
    10


    ========================================================
    Dism /Online /Cleanup-Image /ScanHealth
    Dism /Online /Cleanup-Image /RestoreHealth /Source:X:\Path_to_Windows.iso /LimitAccess
    SFC /scannow
    ========================================================


    So, it should be like that to see if the restoration of the corrupted windows installation was successfull?
    But what about in the beginning, prior of restoring should we check the system with Dism's ScanHealth or with SFC instead?
     
  10. thessalonik

    thessalonik MDL Senior Member

    Apr 7, 2014
    299
    16
    10
    What us a WinSXS coponent or as others say it a Component store?


    WinSXS\Backup is a standalone directory to my present window installation? So SFC is using as a Repair directory a local windows directory while Dism's ScanHealth is using MS Servers for that?
     
  11. november_rain

    november_rain MDL Addicted

    Oct 25, 2012
    508
    3,085
    30
    #13 november_rain, Aug 3, 2015
    Last edited by a moderator: Apr 20, 2017
    It is something to do with Windows 10 nothing is corrupted i have installed 3 on real machine few on Virtual Machine i get same error all of them.!
    MS has to solve this one out both cmd failed as OP described.
    Code:
    sfc /scannow
    Dism /Online /Cleanup-Image /RestoreHealth
    Dism /Online /Cleanup-Image /RestoreHealth /Source:C:\ /LimitAccess
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    #14 s1ave77, Aug 3, 2015
    Last edited by a moderator: Apr 20, 2017
    #1. Run SFC. If not fails all is OK. Else repeat 2 times.
    Code:
    SFC /scannow
    
    #2. If still fails run:
    Code:
    Dism /Online /Cleanup-Image /RestoreHealth
    
    or:
    Code:
    Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:X:\sources\install.wim:1 /LimitAccess
    
    #3. Pray one of the above will work.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. thessalonik

    thessalonik MDL Senior Member

    Apr 7, 2014
    299
    16
    10
    #15 thessalonik, Aug 3, 2015
    Last edited by a moderator: Apr 20, 2017
    (OP)


    1. Why run sfc 2 times? Isn't 1-time enough? SFC both detect and heals as i take it from you response?

    2. RestoreHealth by itself or RestoreHealth with a Source switch specified. Which of those 2 would work best


    Sorry for being a pain in the ass but i cannot accept somethign if not detailed explained.


    For me so far the best solution BUT STILL AMBIGUOUS would be:
    ========================================================
    Mount the Win10.iso Image that was used after formatting to isntall the current OS
    SFC /scannow
    Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:X:\sources\install.wim:1 /LimitAccess
    ========================================================
     
  14. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    Depends on the error itself, sometimes the repeats can help.

    Best is to check the CBS.log SFC mentions. One needs to scroll completely down the looooooong log to find the date and time of last run and look for the logged errors. It will show on which files it exactly fails and why.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. LastWords

    LastWords MDL Member

    Aug 29, 2013
    101
    127
    10
  16. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    16,198
    84,777
    340
    WinSxS = Windows Side by Side
    it's a new mechanism / technology introduced with Vista
    all directories it have are called Components, so it's a Component Store

    It's not a backup to the whole installation , just the vital files of the system
     
  17. thessalonik

    thessalonik MDL Senior Member

    Apr 7, 2014
    299
    16
    10
    So, do we all agree on that:

    ========================================================
    Mount the Win10.iso Image that was used after formatting to isntall the current OS
    SFC /scannow
    Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:X:\sources\install.wim:1 /LimitAccess
    ========================================================

    as a means to correct any windows error that might occur?
     
  18. fardeen

    fardeen MDL Member

    May 11, 2010
    199
    13
    10
    i keep on failing to repair the component store, it fails all the time :( DISM says my sources cannot be found, i converted my install.esd to install.wim, still does not work