Remote restart into safe mode? (windows)

I know you can remotely shutdown a Windows machine with the "shutdown" command line. But I think it's impossible to remotely get a machine into safe mode (with networking). Does anyone know of a way to do this?


Solution 1:

If you have admin rights on the remote machine then it's possible.

You need to edit the boot.ini file (usually found on the root of the C: drive)

Open a command prompt on your local machine

type:

EDIT \\MACHINENAME\C$\BOOT.INI

The boot ini file will open which usually looks something like this:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional"  
/noexecute=optin /fastdetect

On the end of the last line you need to add

/safeboot:network

the last line will then read something like

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional"  
/noexecute=optin /fastdetect /safeboot:network

Save the changes and then force a reboot from the command line and it should restart into safe mode with networking. Remember to change the boot.ini file back when you're done!

Solution 2:

To reboot Windows 7 into safe mode with networking, run msconfig.exe. On the Boot tab, you can select "Safe boot" and there is a checkbox for networking.

I'm not sure if Remote Desktop will run in safe mode. I use TightVNC. To have the TightVNC service start in safe mode, copy it's registry entry to safeboot\network:

REG COPY HKLM\system\CurrentControlSet\services\tvnserver HKLM\system\CurrentControlSet\control\safeboot\network\tvnserver /s /f

Other VNC services can probably be activated in the same way.

Solution 3:

Not likely for a workstation machine. You need something that gives you control of the machine itself in order to tell Windows how to boot.

You will have more luck on server hardware as many vendors build in an option to connect to the console remotely.

If you have the option to interactively connect to Windows on the machine, though, you can use MSCONFIG to set the /SAFEBOOT switch in boot.ini, then reboot the machine. Do Start -> Run and type in MSCONFIG, then on the boot.ini tab check /SAFEBOOT under Boot Options and choose which safe mode you want to boot into (in this scenario, NETWORK).