Connect to a Wi-Fi network using Command Prompt

Satyajit Mishra

Honorable
Apr 11, 2015
92
0
10,630
> I have a perfectly working Wi-Fi USB Adapter with latest driver installed. I can connect to any Wi-Fi network using the Windows GUI i.e. clicking on "Network" icon on the "Task Bar" & selecting a Wi-Fi network.

> But I want to connect to a Wi-Fi network using the "Command Prompt". I have tried almost all the "netsh wlan" commands while running the Command Prompt with Administrative Privilege.

> So here is a scenario, I have 3 available Wi-Fi networks (SSIDs) & i want to connect to only one of them. None of these Wi-Fi networks have never been saved or connected to before my PC ever. So my assumption is that there are no Saved Profiles.

> FYI; I know the SSID, Password, MAC Address etc of each & every one of these available Wi-Fi networks as they are all my own.

>> Please tell me a simple command to connect to a specific Wi-Fi network from a number of available ones.
 
Solution
You will previously need to have connected to the network to have the profile and password saved. I may be wrong but you cannot use the command line to negociate the security, if you have previously connected you can use:

netsh wlan show profile

netsh wlan connect ssid=YOURSSID name=PROFILENAME

and then

netsh wlan disconnect
You will previously need to have connected to the network to have the profile and password saved. I may be wrong but you cannot use the command line to negociate the security, if you have previously connected you can use:

netsh wlan show profile

netsh wlan connect ssid=YOURSSID name=PROFILENAME

and then

netsh wlan disconnect
 
Solution

Satyajit Mishra

Honorable
Apr 11, 2015
92
0
10,630


Sure, that's a valid question. I have multiple Wi-Fi networks with multiple bandwidths i.e. 1Mbps & 2Mbps. My ISP provides 4Mbps D/U speed at night i.e. from 2PM to 5PM. So I want to creating a batch file & hook it up to the task scheduler to run it at a specific time. So I want my batch script to simply switch from one connected Wi-Fi network to another. FYI; I have an Ethernet connection (2Mbps) & two other Wi-Fi networks i.e. 1Mbps & 4Mbps (via different Wi-Fi networks). I am usually connected to the 1Mbps Wi-Fi most of the time & I want my batch file to switch from this Wi-Fi network to the 4Mbps one at night.
 

Satyajit Mishra

Honorable
Apr 11, 2015
92
0
10,630
But can anyone please tell me how to connect to a Wi-Fi network which was never connected to a PC using command prompt. I have the SSID & password, so how can I connect to this network via command prompt?
 


You can not! That is what I was saying previously, without a profile you cant connect to a secured wlan.
 

Satyajit Mishra

Honorable
Apr 11, 2015
92
0
10,630
I just found another problem with the "netsh wlan connect Home WiFi" command. If my SSID has any space between them, then I get this output "There is no profile "Home" assigned to the specified interface.". But when I type "netsh wlan show profiles", it show my Wi-Fi network profile name as "Home WiFi". But when I try to connect to a saved Wi-Fi network whose SSID doesn't have any space, it connects successfully.


Can anyone please clarify how to solve this issue?
 


Rename your SSID???
 

Satyajit Mishra

Honorable
Apr 11, 2015
92
0
10,630


I just got the solution from LinusTechTips Community by zMeul. So by simply using the netsh wlan connect "HomeWiFi" or netsh wlan connect name="Home WiFi" you can connect to a SSID with space!
 


Good news!
 

TRENDING THREADS