you guys are the best
working perfectly
but maybe one more question to this... basicaly little different topic in same script...
well basicaly after I determine this AdapterName, I am connecting my WiFi to different profile:
Code: Select all
@ECHO Waiting for connection to WiFi (MYNETWORK)
@NETSH wlan connect ssid="MYNETWORK" name="MYNETWORK"
:loop_zfguest
@TIMEOUT /t 1 /nobreak >nul
@NETSH interface show interface name="Wi-Fi" | FIND "Connect state" | FIND "Connected" >nul || GOTO :loop_zfguest
which only outputs to me:
Code: Select all
Waiting for connection to WiFi (MYNETWORK)
The network specified by profile "MYNETWORK" is not available to connect.
I know also this was working to me half year ago, but not anymore?
So I was thinking that it does not see other available networks them at the moment, because when I click to Wifi icon in Windows system bar, then it takes couple seconds to load those which are available.
So I was thinking again to refresh this list first by:
Code: Select all
@ECHO Refreshing list of WiFi profiles
@NETSH wlan show profiles
which gives me big list of all wifis which I ever been connected to:
Code: Select all
Refreshing list of WiFi profiles
Profiles on interface Wi-Fi:
Group policy profiles (read only)
---------------------------------
ZFOFFICE
User profiles
-------------
All User Profile : SomeWifiName1
All User Profile : SomeWifiName2
All User Profile : SomeWifiName3
All User Profile : SomeWifiName4
All User Profile : SomeWifiName5
All User Profile : SomeWifiName6
All User Profile : SomeWifiName7
All User Profile : SomeWifiName8
All User Profile : SomeWifiName9
All User Profile : SomeWifiName10
All User Profile : MYNETWORK
Waiting for connection to WiFi (MYNETWORK)
The network specified by profile "MYNETWORK" is not available to connect.
So you can cleary see the last one realy exists, thats the one I want to connect.
I can see it available also when I click to the Wifi icon in windows system tray... so why the batch script says its not available?
Can I somehow refresh the list of available networks and not the old stored profiles?
PS: I have tries:
but it gives me only one wifi network which I am currently connected to...
but when I click onm the wifi icon at the systray, so I let windows load all networks, and then run the:
again, it properly gives me list of all visible availble SSID networks...
so how do I force to refresh the lists to see them all before doing initial:
Code: Select all
@NETSH wlan connect ssid="MYNETWORK" name="MYNETWORK"
?
PS: I found this:
https://superuser.com/questions/889414/ ... mmand-line
some command "explorer.exe ms-availablenetowrks:network-wifi" opens the popup menu like when i click to wifi icon in systray manualy, and force windows to load all available networks... can I do it somehow silently so it wont physicaly open?