Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been using ICS successfully for years, but now I'm looking for a way to control it through something else than the GUI in Control Panel\Network and Internet\Network Connections -> Connection Properties:

I basically want to manually do what this checkbox does

I want to do everything that the encircled checkbox does and more, without touching any GUI. This leads me to the following subquestion:

What does the checkbox do?
Microsoft don't provide specific information and the most helpful forum post I've found is from 2003. Assuming that some of the advice is still valid, I've come to the conclusion that ICS is broken down into 6 parts that have to be set up individually:

  1. the sharedAccess service
  2. interface settings
  3. firewall rules
  4. a static route
  5. dnsproxy
  6. autodhcp

I've already learned that the service can be started/stopped with the command net start/stop sharedAccess and that netsh is a good tool for changing the interface settings and the firewall rules. But I don't understand how ICS handles routing and DNS. All hosts in my network are configured statically, so I don't care much about autodhcp.

Thanks for your help!

EDIT: I spent a day following Randolph West's advice and analyzed the output in ProcMon. I saw reads and writes to both the registry and the filesystem, and it was too difficult for me to understand what exactly it all meant - except that an API was being called.

share|improve this question
Use Process Monitor from to see exactly what it's doing, and then use whatever methods available to script that out. You'll probably find a lot of it is related to the registry, which ProcMon will see. – user3463 Mar 26 '12 at 7:29
Thanks, I'm looking into this now. – Skya Mar 26 '12 at 10:55
up vote 2 down vote accepted

I decided to dig into the Windows API for a solution and found this, the interface which controls the encircled button! Everything else can be controlled with netsh. I wrote a simple C++ utility that lets me start/stop ICS between two network adapters, set the scope for the "DNS server IN" firewall rule and set the IP address of the LAN interface. This is all I needed and I don't think there's any other way to do it.

I've uploaded my solution to sourceforge:

share|improve this answer
Skya, could you expand on how to use your utility I don't see how you can enable ICS since its not detecting my adapters. Right now i'm using a desktop with a wifi card that is connected to a router via ethernet. I have the desktop wifi card setup as an access point with the desktop's internet connection shared with the wifi access point so other users can go online via the Microsoft Hosted Network Virtual Adapter. Is there anyway to see the DHCP client table for that access point? I would like to see all connected users to this AP. – user204401 Mar 5 '13 at 16:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .