How to enable Internet connection sharing using the command line in Windows 7 [duplicate]

How can I share my Wireless Internet with an existing local network?

I don't want to create new Wireless Network Connection 2 using this command:

netsh wlan set hostednetwork mode=MODE ssid=SSID key=KEY keyusage=KEYUSAGE 

Currently I use this:

  1. Open Network Connections by clicking the Start button, clicking Control Panel, clicking Network and Internet, clicking Network and Sharing Center, and then clicking Manage network connections.

  2. Right-click the connection that you want to share, and then click Properties. Administrator permission is required. If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

  3. Click the Sharing tab, and then select the Allow other network users to connect through this computer’s Internet connection check box.

That is a lot of clicks. Using the command line can speed up this process. But I don't know how to do it by command line.

In Windows XP, a user can use

netsh routing ip autodhcp install
netsh routing ip autodhcp set interface name="Local Area Connection" mode=enable
netsh routing ip autodhcp set global 192.168.0.1 255.255.255.0 11520

but in Windows 7 command netsh routing does not exist.


You can cut down on clicking by creating a quick launch button that goes directly to the wireless network connection status panel.

After creating the quick launch toolbar, go to the Start Menu and type ncpa.cpl in the search box. In the window that opens you can drag the icon for the appropriate network to the quick launch toolbar.

It seems the only alternative to this would be a software application. Virtual Router or Connectify Hotspot might meet your needs.