How to Set Up a Computer-to-Computer Wi-Fi Network in Windows 10 and Windows 11

There are times when you need to quickly create a wireless network to share files between computers or provide internet access without a router. In such cases, setting up an ad-hoc network (computer-to-computer) can be a convenient solution. This guide explains how to do it on Windows 10 and Windows 11.

What is a Computer-to-Computer (Ad-Hoc) Network?

An ad-hoc network is a temporary wireless network that allows multiple devices to connect directly to each other without using a router. This is useful when you don't have access to a Wi-Fi network or a router but need to connect devices quickly.

Setting Up an Ad-Hoc Network in Windows 10 and Windows 11

Step 1: Check Your Adapter’s Capabilities

First, ensure that your Wi-Fi adapter supports creating virtual networks. Open the Command Prompt (press Win + R, type cmd, and press Enter). In the Command Prompt, enter the following command:

netsh wlan show drivers

Look for the line Hosted network support. If it says Yes, your adapter can create an ad-hoc network.

Step 2: Create the Network via Command Prompt

Now, you can create the network using the Command Prompt. Enter the command below, replacing Network_Name with your desired network name and Password with a secure password:

netsh wlan set hostednetwork mode=allow ssid=Network_Name key=Password

To start the network, use the following command:

netsh wlan start hostednetwork

If the network starts successfully, you will see a confirmation message.

Step 3: Enable Internet Sharing

If you want connected devices to access the internet, you need to enable internet sharing. To do this:

  1. Open the Network and Sharing Center.
  2. Select the connection that your computer uses to access the internet (e.g., Ethernet or Wi-Fi).
  3. Right-click the connection and select Properties.
  4. Go to the Sharing tab and check the box for Allow other network users to connect through this computer’s internet connection.
  5. In the Home networking connection dropdown, select the created ad-hoc network.

Step 4: Connect Other Devices

You can now connect other devices to the newly created Wi-Fi network. On another computer or smartphone, open the Wi-Fi settings, find the network name you created, and enter the password you set.

Stopping the Network

When you no longer need the ad-hoc network, you can stop it with the following command:

netsh wlan stop hostednetwork

To restart it in the future, use:

netsh wlan start hostednetwork

Troubleshooting Common Issues

Issue: Unable to Start Hosted Network

If you encounter an error when trying to start the network, check that your Wi-Fi adapter is enabled and that its drivers are up to date. Also, ensure that hosted network mode is allowed in the adapter settings.

Issue: Devices Cannot Connect to the Network

If devices are unable to connect, try changing the network password to something simpler or restart the network with:

netsh wlan stop hostednetwork
netsh wlan start hostednetwork

Also, make sure that your firewall settings are not blocking the connection and that internet sharing is properly configured.