如图
通过bat脚本获取当前wifi连接的SSID
期望是通过当前网络(在家和在公司)自动设置相应IP和DNS
设置IP和DNS已解决,不知道如何获取
找到了
netsh WLAN show interfaces可以获取到,然后就是怎么提取SSID了
如图
通过bat脚本获取当前wifi连接的SSID
期望是通过当前网络(在家和在公司)自动设置相应IP和DNS
设置IP和DNS已解决,不知道如何获取
找到了
netsh WLAN show interfaces可以获取到,然后就是怎么提取SSID了
在bat文本中使用指令:netsh wlan show hostednetwork,然后过滤回显信息就行了
哎 !试试这个吧
(netsh wlan show profiles) | Select-String “:(.+)$” | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name=”$name” key=clear)} | Select-String “Key Content\W+:(.+)$” | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize