Repair Corrupted Windows Files (Dism)

open the Event Viewer. On the left in the Event Viewer, go to Windows logs – System, in there you should be able to trace if something is wrong and causing your PC to shut down.

https://www.howtogeek.com/222532/how-to-repair-corrupted-windows-system-files-with-the-sfc-and-dism-commands/

Also check https://answers.microsoft.com/en-us/windows/forum/all/windows-10-performance-and-install-integrity/75529fd4-fac7-4653-893a-dd8cd4b4db00

 

Run as administrator command prompt

SFC /scannow

Dism /Online /Cleanup-Image /CheckHealth

Dism /Online /Cleanup-Image /ScanHealth

Dism /Online /Cleanup-Image /RestoreHealth

DISM /Online /Cleanup-Image /StartComponentCleanup
SFC /SCANNOW
DISM /Online /Cleanup-Image /AnalyzeComponentStore
SFC /SCANNOW

REM reboot
pause

Dism.exe /online /Cleanup-Image /StartComponentCleanup

chkdsk C: /f /r /x

Open your Windows Security settings.Select Virus & threat protection > Scan options.Select Windows Defender Offline scan

Type in “CMD” and hit enter

Type “WMIC” and hit enter

Type “diskdrive get status” and hit enter