The Ad Hoc mode, also called peer to peer mode, allows nodes to communicate directly (point-to-point) without the need for an AP, as in the following Figure. There is no fixed infrastructure. Nodes need to be in range with each other in order to communicate.
computer A and computer B.
NOTE: Before we proceeding, please make sure the Windows Zero Configuration (WZC) service is started. If you are not sure about this, please click here to check the settings.
Part 1: Create an Ad Hoc network profile on computer A
Step 1
Go to Control Panel -> Network Connections and find Wireless Network Connection. Right click Wireless Network Connection and select Properties.

Step 2
On Wireless Networks tab, click Add button.

Step 3
On Association tab of Wireless network properties window, please type a phrase for Network Name [SSID]. In our scenario, we take adhoctest for example. Then go to the bottom and tick This is a computer-to-computer [ad hoc] network; wireless access points are not used. Then click OK.

Step 4
After Step 3, there should be a profile named adhoctest in Preferred Networks. Click OK to save all the settings.

NOTE - BEFORE STARTING WITH THE STEPS PLEASE SWITCH OFF THE FIREWALL OF COMPUTER