I have an Amazon EC2 instance of Windows Server 2008 where some genius managed to disable the network connection so that the instance is now isolated in its own little universe. I can shut down the instance and edit the "C:\" drive volume by attaching it to another running instance. This is equivalent to removing the system drive from a dead machine and attaching it to another computer to edit the files.

Question: Where is the network connection enabled / disabled setting stored?

If I can tweak this setting by editing the registry or a file to re-enable the network connection, I can then resurrect my Amazon server.


From the other PC, open the registry editor and load the HKLM hive from the 'offline' system (Registry -> Load Hive).

Under: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce

Add this command to run (changing the name of the connection if you need to):

netsh interface set interface "Local Area Connection" enabled

When you boot it, it should then enable the connection. I haven't tested that but it should work in theory.

  • I went through that scenario last night. Programs running under "RunOnce" are invoked after the user logs on. Since I can't connect to the instance to log on this event never fires. – John Miner Apr 1 '10 at 18:36
  • You're right, sorry. I was thinking that RunOnce ran at startup and Run was after login. In that case enable AutoAdminLogon under: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon – sinping Apr 1 '10 at 20:09
  • Well, thanks to your heads-up I can create a new instance, disable the network connection, re-boot the instance and then re-connect to the instance. However, for some reason I can't make the same changes on the off-line volume and then re-boot it and connect. Hmm! – John Miner Apr 2 '10 at 6:28
  • Just to follow up. Your suggestion of using the AutoAdminLogon key was the answer. Unfortunately, I wasn't familiar with the use of this key and had to read up (support.microsoft.com/kb/315231) to find out that this key has to be used in conjunction with DefaultUserName and DefaultPassword keys as well. Once this was done, my script executed when the default account logged in automatically and the connection was restored. – John Miner Apr 3 '10 at 2:26
  • To wrap up, my orginal question was naive. Enabling a network adapter by looking for a single key to trigger in the registry doesn't work. By doing a file compare on exported .reg files before and after a network connection is enabled, you can see that many changes in the registry were implemented. So this was not an appropriate approach for trying to tweak the registry in my off-line volume. Invoking a script to re-enable the adapter using the Run and AutoAdminLogon keys as described above is a better way to go. – John Miner Apr 3 '10 at 2:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.