Not strictly a programming question, but I was programming at the time and couldn't find an answer, so I thought, "Hey, I'll give StackOverflow a try!"
So I'm connected to my Windows XP work PC over a Remote Desktop connection through VPN. In a command window (on the remote PC), I foolishly type ipconfig /release
. A split second before I come to my senses, I hit Enter. D'oh!
So what now? Am I hosed until I get to the office Monday morning? Any way to remotely make my office PC get itself a new IP address?
If it makes you feel any better, most of us have done something similar. I can't offer a suggestion that doesn't involve human intervention, but I can offer two ways to prevent a "next time" for you:
Look into a remote power controller. Cheap (inexpensive, hobbyist-grade) options are available through www.x10.com; other vendors (Pulizzi, DataProbe, etc.) provide more reliable solutions for a higher price. You may even be able to find a UPS that allows you to control it via a serial port.
Plug your PC into the power controller, and find a second PC to control it. Now you can reboot your PC remotely, no matter how badly you de-configure it.
Anticipate and compensate. It's reasonable to expect that you may need to release/renew the IP address again, so write a utility that will check for the loss of IP address and reboot if that occurs. For example, ping your default gateway and reboot if the ping fails consistently. Just be sure to anticipate the consequences of an unexpected reboot!