Specify next boot to be into Safe Mode/WinRE via command line?

3

As the title says I would like a script that tells Windows that the next boot should be into Safe Mode or at least that the F8 menu should be presented on next boot.

Booting into WinRE (Launch startup repair...) is probably even more un-doable.

I looked over bcdedit options but didn't see anything like this. I know msconfig has an option for Safe Boot but it's GUI only.

Currently if I want to boot into Safe Mode or launch WinRE then I have to forcefully restart my PC first for those options to be presented during boot (F8 does not bring up the Safe Mode option under normal conditions).

I'm using Windows 7 x64.

TMRW

Posted 2011-01-07T23:24:35.997

Reputation: 974

F8 does work, but there's only about a half-second window, so you have to really hammer the key to get it to show. Not fun. But a direct answer below... – SilverbackNet – 2011-01-07T23:29:15.763

Answers

3

bcdedit /default <id> is how you force it to boot into a non-default partition. Use bcdedit to list them and select the identifier you want. To force the current OS into safe mode at next startup, bcdedit /set {current} safeboot network.

Remember to undo all of this afterward; it might be safer to follow the directions here and create a new id for the safemode option, so that it's easy to switch back.

SilverbackNet

Posted 2011-01-07T23:24:35.997

Reputation: 962

Intresting.I will defenetly look into this. – TMRW – 2011-01-07T23:59:12.437

Ok the code above worked.To disable i used this: bcdedit /deletevalue safeboot – TMRW – 2011-01-08T02:15:54.277