Skip to content
⌘ NSIS Forum Archive

How to test .onRebootFailed Windows 7

2 posts

Marshallx7#

How to test .onRebootFailed Windows 7

I'm trying to trigger .onRebootFailed in Windows 7
But no matter what programs I leave open, unsaved files, etc. the computer reboots when I issue Reboot command. So I cannot test .onRebootFailed.

Does anyone know an easy way to prevent shutdown?
Anders#
It will be called if the user does not have the SE_SHUTDOWN_NAME privilege or something else that causes InitiateShutdown and ExitWindowsEx to return false.

Media Center recording TV or burning a CD will probably block it. Or try it on Windows XP because it is not as strict when it comes to blocking shutdown.

It might not be a true simulation but you can just call the function manually to test the code...