Jump to content

Connect to a Wi-Fi network using Command Prompt

Go to solution Solved by zMeul,
1 minute ago, Satyajit Mishra said:

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?

you need to use quote marks, like:

netsh wlan connect name="Test WiFi"

 

> 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 before. 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.

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, zMeul said:

netsh wlan connect ssid="YOURSSID" key="YOURPW"

doesn't work?

No it doesn't work. And here is an output when using this command;

 

C:\Windows\system32>netsh wlan connect ssid=TestWiFi key=xxxxxxxxxx
'key' is not a valid argument for this command.
One or more parameters for the command are not correct or missing.

Usage: connect [name=]<string> [[ssid=]<string>] [[interface=]<string>]

Link to comment
Share on other sites

Link to post
Share on other sites

I just got the solution from Microsoft Community by Frederik Long. So first you have to connect to the Wi-Fi networking using GUI, then simply type "netsh wlan connect TestWiFi" command or "netsh wlan connect ssid=TestWiFi name=TestWiFi" or "netsh wlan connect name=TestWiFi" the next time you want to connect to it via cmd.

 

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?

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, Satyajit Mishra said:

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?

apparently it's not possible without previously having a profile for that network

 

netsh wlan add profile

 

Edited by zMeul
Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, zMeul said:

apparently it's not possible without previously having a profile for that network

No work arounds or using powershell?

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Satyajit Mishra said:

No work arounds or using powershell?

I'm looking at it right now, it's not possible without an existing profile

see my modified previous post

Link to comment
Share on other sites

Link to post
Share on other sites

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?

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Satyajit Mishra said:

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?

you need to use quote marks, like:

netsh wlan connect name="Test WiFi"

 

Link to comment
Share on other sites

Link to post
Share on other sites

15 minutes ago, zMeul said:

you need to use quote marks, like:


netsh wlan connect name="Test WiFi"

 

netsh wlan connect "Test WiFi" also works!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×