28

I would like to know if there is a command that could be written in the command line to restart the computer and make it boot in safe mode?

If there isn't a command like this, is there any other way to do it?

I would like the process to be fully automated after launching the command.

tshepang
  • 10,772
  • 21
  • 84
  • 127
sSmacKk
  • 1,033
  • 4
  • 15
  • 30
  • See: http://serverfault.com/questions/55063/remote-restart-into-safe-mode-windows it's not "simple". – Marc B Oct 02 '12 at 14:45
  • And operating system is? – Sampo Sarrala - codidact.org Oct 02 '12 at 14:51
  • Operating system is windows server 2003, i forgot to mention, but i guess its obvious now that i have to change the boot.ini – sSmacKk Oct 02 '12 at 15:12
  • Why was this question shut down? It has over 100,000 visits, and contains a question and it's correct answer..?? Please help me to understand why it is 'Off Topic' so I can avoid the same happening to me? – Bevan Dec 29 '15 at 05:24
  • 1
    @Bevan: There is no indication that this is a _programming_ question. It would probably be a better fit for [Super User](http://superuser.com/). – Nisse Engström Mar 31 '16 at 19:18

2 Answers2

66

My first answer!

This will set the safemode switch:

bcdedit /set {current} safeboot minimal 

with networking:

bcdedit /set {current} safeboot network

then reboot the machine with

shutdown /r

to put back in normal mode via dos:

bcdedit /deletevalue {current} safeboot
D3l_Gato
  • 1,245
  • 2
  • 16
  • 23
10

In the command prompt, type the command below and press Enter.

bcdedit /enum

Under the Windows Boot Loader sections, make note of the identifier value.

To start in safe mode from command prompt :

bcdedit /set {identifier} safeboot minimal 

Then enter the command line to reboot your computer.

florentcm
  • 111
  • 3