Run SFC /Scannow and/or DISM /Online /Cleanup-Image /RestoreHealth via script
Hi There,
We recently just upgraded a bunch of laptops for Win11 and they have all been running poorly since.
I was looking the best way to run sfc /scannow and DISM /Online /Cleanup-Image /RestoreHealth via a script to all effected machines.
I have setup a batch file to run, but it just shows ran successfully have no idea if it actually done anything (i.e. is there a way to see if it found errors) If i click the visibile box it still just runs and disappears.
Thanks for your help :)
Answers (1)
Top Answer
For sfc /scannow, you can parse the logs and check the output. Not a drop in check, but better than nothing. Another option could be to use PowerShell and check for an exit code, thats if even sfc.exe provides a exit code.
DISM /Online /Cleanup-Image /RestoreHealth, is same again, just parse the output of the log.
Summary, I think you'll need to roll your own script to do the action, then check the output.