/build/static/layout/Breadcrumb_cap_w.png

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 :)



0 Comments   [ + ] Show comments

Answers (1)

Posted by: rileyz 2 weeks ago
Red Belt
0

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.


Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ