This is an absolutely brilliant solution that helped me connect an ad-hoc network automatically. So I am just re-posting it here, in case the original guide goes down. The Internets must know this solution! Absolutely Brilliant.
This could probably be the ULTIMATE solution! Post a comment if it has helped you!
With each new Windows version, Microsoft has unfortunately chosen to make life harder for people who use ad-hoc networks to connect computers together without the use of a middleman (the router). In Windows Vista, one could choose to save the ad-hoc network one is connecting to.
But with Windows 7, not only is there no way of connecting automatically (well actually there is a shortcut for that, as below), but now one cannot save an ad-hoc network that one is connecting to. (One can only save an ad-hoc network one is creating in the host computer.)
The biggest annoyance is that every time one connects to an ad-hoc network as a guest, one has to enter the password (network key) again. All of these problems can be solved with the steps below.
To save an ad-hoc network and its network key on the guest computer (running Windows 7)
- Note down the SSID, security type, encryption type and the key of the ad-hoc network.
- Disconnect your connection to any wireless network and switch off/disable your wireless device. Turn on/enable your wireless device but don’t connect to any network. (Thanks GK.)
- Click on the network icon in the taskbar.
- Click Open Network and Sharing Center > Manage Wireless Networks > Add.
- Click “Manually create a network profile”. (This may look silly but we really are going to create an infrastructure network now.)
- Enter the network name (SSID), security type, encryption type (if any) and the key that you noted in step 1.
- Uncheck both checkboxes (“Start this connection automatically” and “Connect even if the network is not broadcasting”.) [Note that you cannot have the connection start automatically. If you try to have it checked, step 10 will fail. A different way to start it automatically during system boot is described below.]
- Click Next > Close. Your connection must appear in the list with the icon suggesting infrastructure (two big screens connected to a tube). Don’t worry about it.
- Click Start, type in “cmd” in the search box, press Enter.
- In the Command Prompt, type in “netsh wlan set profileparameter name=NetworkName ConnectionType=IBSS”, exactly as shown, without quotes, except you must substitute NetworkName with the SSID (network name) of your ad-hoc network.
- If everything went well, you’ll see that the icon has now changed to an ad-hoc icon (three small screens connected to each other) in the Manage Wireless Networks window.
- Turn on/enable your wireless device, and try connecting to the Ad-hoc network. You will notice that you no longer need to enter the network key.
- Click Start > point to All Programs > right-click Startup > click Open. (You may choose Open All Users instead if you prefer).
- Right-click an empty space and click New > Shortcut.
- Type in “netsh wlan connect NetworkName“. Once again, NetworkName must be substituted with the SSID of your ad-hoc network.
- Click Next and enter a fancy name such as “Connect to NetworkName” or something like that.
- Click Finish and you’re done. This shortcut will run when Windows starts up, giving you a very brief flash of the black command window, followed by your computer connecting to the ad-hoc network if it is available. Tip: You can also pin the shortcut in your taskbar or copy it to the desktop to easily connect to the network any time you want.