I encountered some strange behavior in Windows XP and Media Center versions, where hibernation or shutdown would hang after the system had serviced RDC connections.  It took a while to solve it.

RDC into a computer that hibernates?! Before jumping to conclusions, it is just a technique I use to access a mobile laptop from my desktop computer, while it is connected at the office.  By RDC’ing into the laptop, it just makes it easier to run both from the same keyboard, mouse and display.

So here’s the scenario:

  • The laptop is brought out of hibernation, I login, and enable the network connection it is going to use.
  • I then go to another computer, and make an RDC connection to the laptop.
  • When complete, I either log off the laptop, or simply disconnect the RDC connection.
  • I then hit the power button to start hibernation, or request a shutdown.
  • Shutdown will start, but hangs during “Saving your settings”.  Hibernation will just not start.  Note: If I login to the laptop on its keyboard before starting hibernation or shutdown, it makes no difference.

The problem seems to occur somewhere in the network layer.  Although the RDC connection was gracefully closed, either a network connection or the RDC service itself is not in a clean state.  Initiating the hibernation or shutdown at this point places the computer in a brain-dead state.  I have had to do a hard reset or power down to recover in each case.

Resolution:

After closing the RDC connection and logging directly onto the laptop itself, performing either of these actions will put the computer into a clean state:

  • Disable the network connection, or
  • Open a console window, and execute ipconfig /release [connection_name] to release the IP address assigned

Just unplugging the cable (or, for wireless, disabling the radio) does not resolve the problem.  By releasing the ip address or disabling the connection in the network connections control panel applet (which releases the ip address as part of the disable), evidently some event is fired which clears out any orphaned dependency at the network layer.

After this action, the shutdown or hibernation sequences will not hang the computer.

<ubergeeking>

So, having solved this, I now use a single batch file through RDC to prepare the laptop to hibernate, and to actually launch the hibernatation process.  It makes getting out of the office a few seconds faster…

😉

1
2
3
4
5
6
7
8
9
10
11
12
13
@echo off
 
REM GoHome.bat -- put the laptop into hibernation after releasing network resources.
 
echo This will release all network adapters and hibernate the computer.
echo Press any key to continue, or Ctrl+C or Ctrl+Break to abort.
echo.
pause > nul
 
ipconfig /release *
 
start rundll32 Powrprof.dll,SetSuspendState
exit

</ubergeeking>