When two laptops with Wi-Fi connect to the same wireless router, the computers can communicate over the local area network, just as if you connected to the router using Ethernet cables. If you want to network two computers directly, however, you can connect them via Wi-Fi using an ad-hoc network. This enables file sharing and other network features even when you aren't near a router.

Step 1

Press "Windows-X" and click "Command Prompt (Admin)" on either laptop. Enter the administrator password to continue if prompted.

Step 2

Type "netsh wlan show drivers" (omitting quotes here and throughout) and press "Enter."

Step 3

Read the line titled "Hosted network supported." You may need to scroll up in the command prompt window to find it. If the line displays "Yes," you can create an ad hoc network. If it shows "No," your laptop does not support this feature. In this case, try the same steps on the second laptop -- only one machine needs to support network creation.

Step 4

Type "netsh wlan set hostednetwork mode=allow ssid=" followed by a name for your network. After the name, type "key=" and a password for the network. The full command will look like the following example:

netsh wlan set hostednetwork mode=allow ssid=samplenetwork key=samplepassword

Press "Enter" to create the network.

Step 5

Type "netsh wlan start hostednetwork" and press "Enter" to open the network to other computers.

Step 6

Click the network status icon on the taskbar of the other laptop. Pick the network you created from the list and enter the password -- connecting to an ad hoc network works just like connecting to a regular wireless network.

Step 7

Open the Network window on either laptop to locate the other laptop's shared folders. You can reach this window by pressing "Windows-E" and clicking "Network" in the left panel.