• DISM command question…what’s the difference between two switches?

    Home » Forums » AskWoody support » Windows » Windows 10 » Windows 10 version 22H2 » DISM command question…what’s the difference between two switches?

    Author
    Topic
    #2566833

    Just what’s the exact difference between the following two similar command switches for DISM:?

    …/cleanup-image /scanhealth and …cleanup-image /checkhealth? Both switches force DISM to check for corrupt items/components in the image (servicing stack as well??), and I would think that both will tell you if they find any, so what else is the difference?? Or is one switch a “newer” version of the older switch?

    I’m basing the above statement on the built-in help that’s available via the /? switch for each level of the command. To get to the help for the switches for /cleanup-image switch, I typed (at an admin-level command prompt) “dism /online/ cleanup-image /?” and read the description for each subsequently available switch that follows the /cleanup-image switch.

    I posted this question in the Windows 10 22H2 forum because that’s the version of Windows I’m currently running. HOWEVER, I believe that this question is pertinent to any version of Windows from Windows 7 through 11, as I’ve seen reference to dism in the Windows 7 Resource Kit that I still have.

    Thanks in advance for any clarification anyone can give who’s had experience using dism.

    Viewing 2 reply threads
    Author
    Replies
    • #2566844

      CheckHealth checks whether the image was “flagged” as corrupted by a failed process (i.e. it doesn’t actually scan the image, it just looks for the flag.)

      ScanHealth actually scans the image for possible component store corruption (i.e. it scans/verifies each individual component is still healthy.)

      If either check returns an error, you need to use the RestoreHealth option to attempt to repair the image.

      See Microsoft’s official Repair-WindowsImage (DISM) page for more details.

      2 users thanked author for this post.
      • #2566848

        CheckHealth…(i.e. it doesn’t actually scan the image, it just looks for the flag.)

        ScanHealth…(i.e. it scans/verifies each individual component is still healthy.)

        Ah, OK, got it now! From the sounds of it, the CheckHealth switch should run to completion much faster than the ScanHealth switch because it’s not as thorough of a check.

        For those reading this thread, although the commands listed on the linked page above are shown on the page as PowerShell commands, they also work on the regular, everyday, command prompt line as well.

        Since this tool has the potential to modify the Windows image that’s currently installed and running, please remember to run either the command prompt or the PowerShell environment as an administrator.  😉

        Although I’ve marked this as resolved, if anyone has any other suggestions or comments pertinent to these particular dism switches, feel free to drop a line here!

        • #2566849

          please remember to run either the command prompt or the PowerShell environment as an administrator.

          Not to worry, dism will only run from an elevated PowerShell or Command Prompt.

          my-dism

          Restorehealth is the only switch I use.  If there’s nothing wrong, no harm done.  If repairs are needed, I’ll need to run it anyway.  It saves time to just use restorehealth.

          Always create a fresh drive image before making system changes/Windows updates; you may need to start over!
          We all have our own reasons for doing the things that we do with our systems; we don't need anyone's approval, and we don't all have to do the same things.
          We were all once "Average Users".

          1 user thanked author for this post.
    • #2566851

      Another question just came to mind regarding the use of either one of the aforementioned switches, along with the use of the /RestoreHealth switch. Are the results of these scans/repairs documented in cbs.log, or are they documented elsewhere instead?

      • #2566874

        From the MS page linked above: -LogPath
        Specifies the full path and file name to log to. If not set, the default is %WINDIR%\Logs\Dism\dism.log

        cheers, Paul

    • #2566854

      There’s a typo in my initial/original post above, but I spotted it too late to edit the post. 😳

      Where I said “…dism /online/ cleanup-image /?”, I forgot to put a space between the word “online” and the next forward slash (/).  There’s also an extra space between the second forward slash and the words “cleanup-image” that’s unneeded. So, the command should read:

      dism /online /cleanup-image /?

      Sorry for any confusion I may have caused.  🙁

    Viewing 2 reply threads
    Reply To: DISM command question…what’s the difference between two switches?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: