I'm looking for a way to force Windows XP Pro SP3 to display the 'It's now safe to turn off your computer' screen when doing a shutdown.
The reason behind is that I want my UPS to turn off/on the power at some point and the PC should startup automatically again after the power cycle. In the BIOS this can be configured so that the PC powers on automatically if it sees power is being restored, but only if the PC was running before the power went away initially.
It seems it was possible to force this in Windows XP < SP1 by calling ExitWindowsEx
with the EWX_SHUTDOWN
uFlags parameter
See here for details
So why was this removed in SP1 and higher?
Any other ways to force this?
How to Make the Screen Turn Off Automatically in Windows 10. To control how fast your displays turn off, head to Start > Settings > System > Power & sleep and customize the times under the Screen header.
Windows XPRight-Click on "My Computer", and click "Properties" from the context menu that appears. Click on the "Advanced" tab. Click on "Settings" under "Startup and Recovery" (see screenshot). Uncheck the box labeled "Automatic Restart".
Press the Windows logo key + X on your keyboard, and then select Shut down or sign out > Hibernate.
Many computer users were trained never to turn their PCs off by pressing the power button on their desktop PC's case. This used to cause problems in the previous millennium, but it's now perfectly safe to shut down with the power button.
After two days of searching, I finally solved it, well actually a colleague of mine :-) !
Read this article for the details: https://web.archive.org/web/20140209015215/http://support.microsoft.com/kb/819760
Essentially it comes down to running:
reg add HKLM\Software\Policies\Microsoft\Windows NT /v DontPowerOffAfterShutdown /t REG_DWORD /d 1 /f
And then calling ExitWindowsEx
with option EWX_SHUTDOWN
from my application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With