I know there are API's to reboot the system,
InitiateSystemShutdown() is just one of them.

However, I need to update firmware in an embedded device, and there's no way I want to attempt this with Windows running.

I'm thinking I need to reboot in Safe Mode or force a reboot to the F8 screen.

This URL makes mention of using environment variables during a reboot
[URL=http://support.microsoft.com/kb/315222]

Safe Mode with Command Prompt (SAFEBOOT_OPTION=Minimal(AlternateShell)): This option is the same as Safe mode, except that Cmd.exe starts instead of Windows Explorer.

or
An environment variable is set when you use one of the Safe Boot options. The environment variable is SAFEBOOT_OPTION. This variable is set to either Network or to Minimal.


I've tried manually going into Control Panel, creating those environment variables, then use Ctrl-Alt-Delete to reboot. Oddly enough, the system reboots, and those vars are no longer in control panel. T
The system did not go into Safe Mode as I had expected. I've been pouring over the MSDN, but I'm obviously using the wrong terminology for searching.

1. Would someone point me to some code/docs which shows how to "programmatically" reboot a machine in Safe Mode (or console only)?

2. Is there a way to programmatically reboot an XP machine so it reboots into the "Windows Advanced Options Menu (The F8 screen)?

3. Is it possible to programmatically create an entry in the
"Windows Advanced Options Menu (The F8 screen), so the user can select
"Download firmware to My Device"?