-
February 9th, 2007, 07:50 PM
#1
Programmatically restarting Windows in Safe Mode to update firmware
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"?
-
February 10th, 2007, 02:36 AM
#2
Re: Programmatically restarting Windows in Safe Mode to update firmware
I went to MSCONFIG to the Boot.ini tab, and when I selected /safeboot and Apply, the env variable was added to the startup line right under Operating System. You can probably modify that file yourself.
-
February 10th, 2007, 10:05 PM
#3
Re: Programmatically restarting Windows in Safe Mode to update firmware
Originally Posted by dglienna
I went to MSCONFIG to the Boot.ini tab, and when I selected /safeboot and Apply, the env variable was added to the startup line right under Operating System. You can probably modify that file yourself.
Thanks. I've tried this.
Where is boot.ini? I did a search with explorer from the root of c, and could not find it.
-
February 11th, 2007, 12:26 AM
#4
Re: Programmatically restarting Windows in Safe Mode to update firmware
It's hidden. Go to your System Properties, and on the Advanced tab, click the startup options, and click EDIT. It appears to be in the root partition.
-
February 12th, 2007, 12:38 PM
#5
Re: Programmatically restarting Windows in Safe Mode to update firmware
Originally Posted by dglienna
It's hidden. Go to your System Properties, and on the Advanced tab, click the startup options, and click EDIT. It appears to be in the root partition.
Ok- I can see it from control panel.
I've got "Do not hide system and hidden files" specified in Explorer, but this file is still hidden.
If I make edits to this through a program, will these edits be "retained" or will Windows overwrite this file before shutting the system down?
-
February 12th, 2007, 01:04 PM
#6
Re: Programmatically restarting Windows in Safe Mode to update firmware
I suggest you have a good look to the next chexkbox which is concerning a certain mask to apply or not to apply to the protected files !
-
February 12th, 2007, 11:37 PM
#7
Re: Programmatically restarting Windows in Safe Mode to update firmware
I would guess that the info is in the registry, as well, but haven't looked at where it may be.
-
February 13th, 2007, 02:50 AM
#8
Re: Programmatically restarting Windows in Safe Mode to update firmware
Originally Posted by dglienna
I would guess that the info is in the registry, as well, but haven't looked at where it may be.
That assumes one knows where to look and what to look for.
-
February 13th, 2007, 03:10 AM
#9
Re: Programmatically restarting Windows in Safe Mode to update firmware
Well, I found a MSCONFIG Hive that seems to have the keys that get set. Only one of four is set on my machine. I'd look to see which ones change when you change settings in msconfig.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|