@echo off
rem 自动切换连接两个无线信号SSID
title 切换无线WIFI
set "ssid1=这里输入你的wifi1"
set "ssid2=这里输入你的wifi2"
for /f "tokens=1* delims=:" %%a in ('netsh wlan show interfaces^|find " SSID "') do (
for /f "tokens=*" %%c in ("%%b") do set "ssid=%%c"
)
echo;当前="%ssid%"
if /i "%ssid%" equ "%ssid1%" (
netsh wlan disconnect
netsh wlan connect "%ssid2%"
echo 切换为"%ssid2%"
) else (
netsh wlan disconnect
netsh wlan connect "%ssid1%"
echo 切换为"%ssid1%"
)
pause :: 不要这行可以自动关闭窗口
exit
windows bat脚本 ,两个wifi互相切换
于 2024-01-02 16:13:16 首次发布