Share
If you are using windows PC and if you want to create Wi-Fi hotspot in your PC then hopefully this tutorial will be helpful for you. Just follow the steps that I have shown below to create a hotspot network.
Create WIFI Hotspot Using CMD in Windows PC

Step 01:
Open CMD( Command Prompt) in administrator mode.

Step 02:
Inside the command prompt type- netsh wlan show drivers and press enter to check whether you have necessary drivers in your PC to create hotspot. If it shows- Hosted network supported: Yes then you are ready to go.

Step 03:
Type in the CMD the following command and press enter.
netsh wlan set hostednetwork mode=allow ssid=HotspotName key=Password

Notice: In this command just change the ssid and key value ie, name your hotspot and give a tight password.

You are done here creating a Wi-Fi hotspot environment. Now to start and stop the hotspot follow the below steps-

#Start Hotspot: Open CMD in administrator mode and type-
netsh wlan start hostednetwork

#Stop Hotspot: Open CMD in administrator mode and type-
 netsh wlan stop hostednetwork

If you want to save your time from writing CMD commands again and again then create a CMD command .bat file on your Desktop and run that when it is necessary. Write the below codes in your .bat file and execute on demand-
C:\Windows\System32\cmd.exe /c Your_Command
Example: C:\Windows\System32\cmd.exe /c netsh wlan start hostednetwork

If you don't know how to create .bat file then visit this link.
Before calculating the total number of host and subnets of a certain IP address you have to have a clear idea about the IP classes. By looking at the first four bits of IP address you can determine the class of address.
  • Class A- It begins with 0xxx, or 1 to 126 decimal. 
  • Class B- It begins with 10xx, or 128 to 191 decimal.
  • Class C- It begins with 110x, or 192 to 223 decimal.
  • Class D- It begins with 1110, or 224 to 239 decimal.
  • Class E- It begins with 1111, or 240 to 254 decimal.
Determine the Number of IP Subnets and Hosts
Every IP address has two parts- Network and Host. For different classes the network and host parts-
  • Class A- Network.Host.Host.Host
  • Class B- Network.Network.Host.Host
  • Class C- Network.Network.Network.Host
  • Class D- Network.Network.Network.Network
For this tutorial we will use the following IP address:
162.190.107.127
255.255.255.224

Step 01: 
Determine the class of address using the first octet of the IP address.
162.190.107.127 = Class B
255.255.255.224

Step 02:
Now, determine the host and network octets.
Network.Network.Host.Host = Class B
162.190.107.127
255.255.255.224

Step 03:
Find out which bits are set to one in the host octets. Notice, if no bits are set to one then there is no subset.
162.190.107.127
255.255.255.224 = xxxxxxxx.xxxxxxxx.11111111.11100000 

Step 04:
Assume 'X' denotes the total number of ones. Then we will use this formula '(2^X)-2' to find out number of usable subnets. Example-
11111111.11100000 = 11 ones.
(2^11)-2= 2048-2= 2046 subnets in total for use.

Step 05:
Assume 'Y' denotes the total number of zeros. Then we will use this formula '(2^Y)-2' to find out number of usable hosts. Example-
11111111.11100000 = 5 zeros.
(2^5)-2= 32-2= 30 host address for use.