https://winaero.com/avoid-accidental-and-automatic-shut-down-or-restart-with-shutdownguard/
Avoid accidental and automatic shut down or restart with ShutdownGuard