Automatic Ad-Hoc in Windows 7

This How-To will assume you have marginal experience in navigating the Windows 7 operating system. First I will cover setting up the host machine, then I will cover setting up the clients that connect to it.

Setting up the Host:

  1. Decide on a network name, security type, encryption type and the key of the ad-hoc network.
  2. 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.
  3. Click on the network icon in the taskbar.
  4. Click Open Network and Sharing Center > Manage Wireless Networks > Add.
  5. Click “Create an ad hoc network”.
  6. Read the information and click next.
  7. Enter the network name (SSID), security type, encryption type (if any) and the key that you decided in step 1. Make sure you check the box to “Save this network”!
  8. The ad hoc network will then be created.

Now that the host has been setup with the ad hoc network, we must configure it to broadcast that network at login in order for clients to be able to connect to it. To enable automatic connection:

  1. Launch the Task scheduler.
  2. In the task pane on the left, right click on “Task Scheduler (Local)” and click “Create Task…”
  3. Under the General tab, name the task “Automatic ad hoc”. Adjust Security options to meet your needs if necessary.
  4. Under the Triggers tab, click “New…”
  5. In the New Trigger windows select to begin the task at log on. (Important)
  6. Under the Actions tab, click “New…”
  7. The action should be Start a Program, and the program you want to run is netsh.exe (which can be browsed to).
  8. In the add arguments box, type: “wlan connect NetworkName” (Without the quotes). NetworkName must be substituted with the SSID of your ad-hoc network.
  9. Click Okay.
  10. If you are using a laptop, go to the Conditions tab and uncheck the box that says “Start the task only if the computer is on AC power” That will prevent the connection from starting if using battery power. If you aren’t using a laptop, skip this step.
  11. Click Ok to save the task.
  12. Log out and back in to see if it works.

Now you must set up the clients to connect to the host. Repeat these steps on all the machines that you will connect to the wireless ad hoc network. To connect a client to the host network:

  1. 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.
  2. Click on the network icon in the taskbar.
  3. Click Open Network and Sharing Center > Manage Wireless Networks > Add.
  4. Click “Manually create a network profile”.
  5. Enter the network name (SSID), security type, encryption type, and the key that you set up on the network host.
  6. Uncheck both checkboxes, “Start this connection automatically” and “Connect even if the network is not broadcasting”.
  7. Click Next > Close. Your connection must appear in the list with the icon suggesting infrastructure (two big screens connected to a tube).
  8. Launch a Command Prompt, type in “netsh wlan set profileparameter name=NetworkName ConnectionType=IBSS” without the quotes, exactly as shown. You must substitute NetworkName with the SSID (network name) of your ad-hoc network set up on the host.
  9. 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.
  10. Try connecting to the ad hoc network. You will notice that you no longer need to enter the network key.
  11. Repeat the task scheduling process above exactly as described to automate the connection process.

You should now be set up with automatically connecting machines using an ad hoc network!

Continue Reading