Any way to start or control ICS from the command prompt?

  • Thread starter Thread starter Colin Higbie
  • Start date Start date
C

Colin Higbie

Is there any command line utility to activate or change the connection that
is used for Internet Connection Sharing (ICS)?

I want to set up a couple of batch files to automate switching between 2
connections:

1. When weather is bad, switch over from satellite to dial-up and share it
2. When weather clears, switch to high-speed satellite and share it

Note, I don't expect the computer to determine if the weather is bad. :-)

I don't mind manually running these batch files (I expect to), I just want
to get it down to a single operation, instead of opening the network
connection, going to the advanced tab, selecting sharing, approving the
change, etc. Bad weather blocks out satellite Internet frequently. It's not
like satellite TV which only goes out during the worst driving rain, maybe
twice a year. Satellite Internet can go out from a light drizzle, so I often
need to switch back and forth several times a week.

I have also noticed that the whole Advanced tab for selecting ICS is only
available to Administrator accounts. It is my hope that by using batch files
and adding the other user (my wife) to the Network Configuration Operators
group (via lusrmgr.msc) that she too will be able to run these two batch
files from her non-Admin account.

Thanks for any suggestions,
Colin
 
Is there any command line utility to activate or change the connection
that is used for Internet Connection Sharing (ICS)?

I want to set up a couple of batch files to automate switching between 2
connections:

1. When weather is bad, switch over from satellite to dial-up and share
it 2. When weather clears, switch to high-speed satellite and share it

Note, I don't expect the computer to determine if the weather is bad.
:-)

I don't mind manually running these batch files (I expect to), I just
want to get it down to a single operation, instead of opening the
network connection, going to the advanced tab, selecting sharing,
approving the change, etc. Bad weather blocks out satellite Internet
frequently. It's not like satellite TV which only goes out during the
worst driving rain, maybe twice a year. Satellite Internet can go out
from a light drizzle, so I often need to switch back and forth several
times a week.

I have also noticed that the whole Advanced tab for selecting ICS is
only available to Administrator accounts. It is my hope that by using
batch files and adding the other user (my wife) to the Network
Configuration Operators group (via lusrmgr.msc) that she too will be
able to run these two batch files from her non-Admin account.

Thanks for any suggestions,
Colin

I don't know if there is any way of getting ICS to work via the command
line (if there is a way, it would be somewhere in netsh.exe). The closest
you'll get to enabling ICS is via Netsetup.cpl (or rundll32
netwiz.dll,HomeNetWizardRunDll). This gives you the Network Setup Wizard.



However, it is possible to enable ICS programatically (via the TypeLib
available in hnetcfg.dll). Unless you have knowledge/expertise in
programming with COM, this may not be an option for you. In that case,
you'll have to find some third party program/script to do it.


If you do wish to try the Programming route, the procedure is almost
identical to opening ports in the Firewall. Once you have the
INetSharingConfiguration interface, instead of adding a port mapping, use
the EnableSharing/DisableSharing methods. The connection should now be
shared. The tough bit is getting the INetSharingConfiguration interface.

Good Luck.


--
------------------------------------------------------------------------
oshah
Control Panel -> System -> Advanced -> Error Reporting -> Choose Programs
-> Do not report errors for these programs:

Acrobat.exe
waol.exe

------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top