Re: Rebooting to safemode

Posted by Filip

In Reply to Rebooting to safemode posted by Smit

Does anyone know how to reboot the computer from delphi, rebooting into safe mode would be a bonus.

To shut down Windows and then restart:
ExitWindowsEx(EWX_REBOOT, 0);

To shut down Windows and turn off the power:
ExitWindowsEx(EWX_POWEROFF, 0);

To shut down the system when it is safe to turn off the power, after all file buffers have been flushed to disk, and all running processes have stopped:
ExitWindowsEx(EWX_SHUTDOWN, 0);

To force applications to terminate even if they don't respond, instead of bringing up the "application not responding" dialog:
ExitWindowsEx(EWX_FORCE, 0);

Related Articles and Replies