DISM /ScanHealth and /RestoreHealth

Those two DISM commands only exist for an online image, because you need a live WinSxS to compare installed files against. There is no equivalent for offline images because nothing has been installed.

When NTLite loads your online image, it has exclusive access to the DISM mount point and no other DISM commands can run against it. That's the normal way DISM works, and you can't run a separate repair or scan command until NTLite unloads the image. So in this case, it's not possible for NTLite run the command on your behalf unless the online image wasn't loaded.
 
DISM++ allows to mount images offline and perform DISM ScanHealth, but I am not sure how it works. I think it compares WinSxS from ISO with already expanded files in the same ISO.
 
The only case where this makes sense is scanning a captured sysprep image. But I have no idea why DISM++ is this stupid.

1. Mount clean install.wim from DISM++
2. Run Recovery / Scan Health. "The image is intact. No repair needed."

3. Delete \mount\Windows\System32\notepad.exe
4. Run Recovery / Scan Health. "The image is intact. No repair needed."
 

Attachments

  • Screenshot 2024-02-14 040445.png
    Screenshot 2024-02-14 040445.png
    20.5 KB
  • Screenshot 2024-02-14 040635.png
    Screenshot 2024-02-14 040635.png
    55.9 KB
I deleted all the \Windows\System32 DLL's from my mounted image. DISM++ ain't that smart.
 
I think NTLite should include a feature to run DISM ScanHealth and DISM RestoreHealth for offline and online images.
Thanks for the suggestion. On paper, maybe, if someone configured an image manually and doesn't want to start fresh.
Best is fresh ISO, faster and more reliable than repairing, then use a preset to get to where you want to.
Don't use images to store changes, use presets and REGs.

However, Microsoft does advertise that it's possible to repair an image as well using the "/Source:c:\test\mount\windows".
It's just I never succeeded in using that option. Tried all combinations that came to mind, repair would still fail on a broken image.
Maybe DISM fixed it in the meantime, maybe host OS can pull files online regardless of the target, I just haven't seen it in action.

The repair is mostly needed for the deployed OS anyway, but then it's just one command, not necessary to bloat the UI for it... unless there are custom steps necessary, preparation of that Source etc, keeping an eye on that one.
 
However, Microsoft does advertise that it's possible to repair an image as well using the "/Source:c:\test\mount\windows".
It's just I never succeeded in using that option. Tried all combinations that came to mind, repair would still fail on a broken image.
Maybe DISM fixed it in the meantime, maybe host OS can pull files online regardless of the target, I just haven't seen it in action.

Reading between the lines, this wording strongly implies it's for a captured image:
Repair a Windows image using DISM. You can repair offline Windows image in a WIM or VHD file, or an online Windows image.

Why would you store an offline image on a VHD file, other than it's a live system capture? For testing, I renamed one of the Windows boot folder's language MUI's (fr-CA) and performed a DISM capture.

DISM++ finally reported an error:

1707932890403.png

RestoreHealth didn't work so well. I don't know how to pass a missing /source: parameter from DISM++.

1707934412986.png
 
NTL and DISM++ is not the same - latter will always show and error - same if you do it on a fresh NTLited installed image.
It's a Windows thing.
 
Why not a batch script that runs after first login? I have one ive implemented, but have to figure out how to delay for 1-2min after first log in.
 
Code:
cmd /c start "" /min cmd /k "timeout /t 5 > nul && echo hello world"
 
DISM++ is perfect as a cleaning tool - especially with NET. assembly cache same way NTL do after montly (NET.) updates using RemoveReinstalls or run a preset.
 
DISM++ is perfect as a cleaning tool - especially with NET. assembly cache same way NTL do after montly (NET.) updates using RemoveReinstalls or run a preset.
NTLite has .NET Assembly deletion on C:\Windows as a component, do it once and it will be in the remove reinstalls.
Also can run DISM Cleanup and there are Cache and temp files component for various rest.
 
I'm aware about that after monthly updates using NTL.
Only difference is, that DISM++ remove .NET Assembly Cache on the fly on installed Windows as the cache gets created everytime user uses a .NET depending software which seems standard nowadays to use for programmers.
Neither Ccleaner or Privazer does this for clean up of temp files.
Kind like a regular housekeeping on daily basis to make the PC/ Laptop run perfect.
Just to say i've nothing to do with DISM++ exept using.
Only think every Windows user should have a combination of different cleaning tools and make their own way to fit they goals so they have a clean stable running system.
Sorry if that's out of scope here in NTL forum.
Thanks.
 
Last edited:
There's no point in clearing the .NET Global Assembly Cache (GAC) on a live Windows, it actually worsens .NET performance.

.NET apps are executed by the CLR using Just in Time (JIT) compilation, but frequently run apps can bypass the JIT step and re-use previously compiled assemblies in the GAC. When you install a new version of .NET, ngen (unless the scheduled task's been disabled) spends several minutes (and lot of background CPU time) rebuilding the GAC.

The next time .NET apps run, they should see performance gains. By clearing the cache, you're forcing .NET apps to take longer to start up.

For an offline image, it can make sense to clear the image's version of the cache because it's likely going to be invalidated. But not for a running system, unless you like it being slower.
 
I see your point.
But on never hardware what private consumers buy it dosen't make any difference.
If you have outdated/old hardware, which some employers also purchase (the cheapest) for their employees, then it's uphill.
 
I'm aware about that after monthly updates using NTL.
Only difference is, that DISM++ remove .NET Assembly Cache on the fly on installed Windows as the cache gets created everytime user uses a .NET depending software which seems standard nowadays to use for programmers.
Neither Ccleaner or Privazer does this for clean up of temp files.
Kind like a regular housekeeping on daily basis to make the PC/ Laptop run perfect.
Just to say i've nothing to do with DISM++ exept using.
Only think every Windows user should have a combination of different cleaning tools and make their own way to fit they goals so they have a clean stable running system.
Sorry if that's out of scope here in NTL forum.
Thanks.
Sure, I know what the .NET Assembly is, and there is a component for it in NTLite.
It will re-appear as soon as it's rebuilt, so you can keep on deleting it when you want.
Just load C:\Windows as the target - it can delete on images as well, but on image it's not re-created until deployed.

If you see that DISM++ removes anything extra, let me know with the details so it can be implemented - I'm always up for more removals if it's safe.
 
Back
Top