Connect to a Wi-Fi network using Command Prompt

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

Question Info


Last updated May 25, 2020 Views 6,952 Applies to:

You need to connect to each network with the GUI method, then save the profile with the command

netsh wlan export hostednetworkprofile

You can then connect to this network with this command:

netsh wlan connect ErsinNetwork

5 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Thank you so much for replying to quick. Any way after entering "netsh wlan export hostednetworkprofile", I got this output, "Profile to connect to the hosted network is saved successfully in file "TestWiFi.xml".". Then using the "netsh wlan connect TestWiFi" connected me to the desired Wi-Fi netowrk with this output, "Connection request was completed successfully.".

But I also found that simply connecting to a Wi-Fi netowrk creates a profile, so even if I skip the "netsh wlan export hostednetworkprofile", I can simply connect to the saved Wi-Fi network by using the "netsh wlan connect TestWiFi" command or "netsh wlan connect ssid=TestWiFi name=TestWiFi" or "netsh wlan connect name=TestWiFi".

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? ​​​​​​​

1 person was helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

If you have a SSID with space, please use "" to specify the name i.e. if your SSID is Home WiFi, type netsh wlan connect "Home WiFi" or netsh wlan connect name="Home WiFi"

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Hi Satyajit,

There is no available command in the command prompt yet that lets users connect to a wireless network they haven't connected before. For now, you can only connect to the wireless network via command prompt if the network profile is already registered in the computer.

You can use the Windows Feedback app so that you can make a suggestion to add the command that will let users connect to a wireless network they haven't connected before.

If you have any questions, please reply to this thread.

10 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.