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?
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?
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:
The boot ini file will open which usually looks something like this:
On the end of the last line you need to add
the last line will then read something like
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!
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:
Other VNC services can probably be activated in the same way.
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).
LogMeIn has a safemode reboot option.
This is exactly what HP's integrated lights-out option is for. Editing the boot.ini file won't be much help, since you won't be able to log into the machine, as the RDP service won't run. In case that's an HP server though you can connect directly to it's console via https portal, and also have access to virtual "power button".
Not an answer to the question, but hopefully useful to anyone who's hit issues when trying this. I found that despite rebooting in safe mode with networking, various services including
Remote Desktop Services
andServer
(i.e. providing SMB access toboot.ini
) failed to start, giving error code 1084 when started via MMC > Services.The below powershell uses WMI (which seems to still work) to take the remote computer out of safe mode and restart it.
Note: You can just run the 3 lines below; the function above is just there as a convenience wrapper. I've not tested the above cmdlet; though I have used this method without the wrapper so can say that all individual parts work.
Note: I've only tried this on Windows Server 2008 R2. YMMV.
That answer above about edit the boot.ini , is nice and all -- EXCEPT....you can't change the boot.ini file...if you follow "Mark's" directions step by step - you hit a brick wall because the boot.ini is read only.
EDIT: And yes....I tested it signed in as an administrator to.
If you hastily chose to modify the
BOOT.ini
to restart in safe mode with networking, and then restart, you will find that you cannot remotely log in at all. You WILL likely be able to view the boot file\\machinename\C$\boot.ini
, but won't be able to modify it because it is read only. You will also not be able to "right-click and uncheck 'read-only' " because you won't be able to navigate to theC$
directory at all. I now have to physically login to this virtual workstation in order to change theboot.ini
back. I will never make that mistake again!What happened to the boot.ini file?
Windows 7 More
In earlier versions of Windows, boot.ini was a system file that contained information about the Windows operating systems installed on a computer. This information was displayed during the startup process when you turned on your computer. It was most useful in multiboot configurations, or for advanced users or administrators who needed to customize how Windows started.
In this version of Windows, the boot.ini file has been replaced with Boot Configuration Data (BCD). This file is more versatile than boot.ini, and it can apply to computer platforms that use means other than basic input/output system (BIOS) to start the computer.
If you need to make changes to BCD, such as removing entries from the list of displayed operating systems, use the command-line tool Bcdedit, an advanced tool intended for administrators and IT professionals. For technical information about Bcdedit, go to the Microsoft website for IT professionals.
If your computer is a multiboot configuration, you can still change which Windows operating system opens by default, and how long to display the list of operating systems, by using System in Control Panel.
2.In the left pane, click Advanced system settings. Administrator permission required If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
3.Click the Advanced tab, and then, under Startup and Recovery, click Settings.
4.Under System startup, choose a default operating system and the amount of time to display the list of operating systems, click OK, and then click OK again.
http://windows.microsoft.com/en-ca/windows/what-happened-boot-ini-file#1TC=windows-7
If you should make this mistake, you will likely be able to navigate to the boot.ini file via File Explorer, so \hostname\C$\boot.ini, and there is a chance you will also be able to remove "/safeboot:network" and save.
If you can save the change to the boot.ini file, then run a command prompt as admin and try running this command to reboot: shutdown /r /m \hostname /t 00
Hopefully with this you'll be back in business!