Using your Windows 7 Laptop as a mobile hotspot #in

Posted on February 07, 2012

Summary : This provides a way to share a connection (wired or 3G) from your laptop via wireless to other devices such as iPads, tablets or mobile phones.

Since I bought my iPad i don’t use my laptop (running Windows 7 Professional) as frequently, especially while travelling. I take the laptop with because there are some things that just don’t work as well on the iPad, but most nights the iPad allows me to check mail, read websites and just do enough of what needs being done. Both my laptop and iPad have a Cell C 2Gig / month prepaid card in them. As a result of the above usage patterns I am finding that in the last 2 months I have used up my allocation on the iPad by the end of the month while having unused¬†bandwidth¬†“lost” on the laptop.

I started looking around for a way to be able to share the bandwidth between the two more dynamically. There are hardware options to get a mobile hotspot, and these are available for as little as R700, however, this is yet another device to carry around and I already have too many, so for now that wasn’t the best option.

Google pointed me to a few software hotspots, I downloaded a few, but they all had limitations (such as only the “Pro” version being able to share a 3G connection) or wanted payment, which for software I hadn’t heard of and couldn’t test I wasn’t keen on.

After a little more searching I found the good news that Windows 7 has the functionality built-in. The only downside is that there is no GUI for this functionality. It requires a couple of DOS commands to be entered at the command prompt. No worries though, they can be scripted into a batch file which you can keep on your desktop and then just run as required (though it must be run as administrator).

The specific commands required are :

netsh wlan set hostednetwork mode=allow ssid=AAA key=BBB
netsh wlan start hostednetwork
pause
netsh wlan stop hostednetwork
pause

Note that the specific name of the connection you are creating must be inserted in the first line where I have AAA and your chosen key replaces the BBB.

Create a batch file (wifihotspot.bat) on your desktop, cut and paste in the above lines, edit the batch file, replacing the names with your choice. That is it. You should now be able to run the batch file (as administrator) and share your connection. To do so, just right-click on the batch file, select Run as administrator and away you go. Simple and effective.

The pause statements are to show you the status after the network is set up, and then to allow you to leave the batch window open until you want to shut down the network, press a key and it’s off. If you prefer you could split this into two separate batch files for an “on” and “off”.

On my machine I get the following responses when running the batch file:

C:\Windows\system32>netsh wlan set hostednetwork mode=allow ssid=AAA key=BBB
The hosted network mode has been set to allow.
The SSID of the hosted network has been successfully changed.
The user key passphrase of the hosted network has been successfully changed.
C:\Windows\system32>netsh wlan start hostednetwork
The hosted network started.
C:\Windows\system32>pause
Press any key to continue . . .
C:\Windows\system32>netsh wlan stop hostednetwork
The hosted network stopped.
C:\Windows\system32>pause
Press any key to continue . . .

Enjoy, and please share any enhancements, improvements or problems being experienced.

%d bloggers like this: