无线网络的切换bat

时间:2023-03-08 22:33:19
无线网络的切换bat

内网外网都是无线,切换起来麻烦,做了两个个bat(注意,切换网络的时候有延时,就点两次)。

-------------------下面的是切换到内网--------------------------------------------

@echo.

@echo    -------------------------------------------

@echo.

@echo     更改“无线链接”:静态设置IP地址

@echo     网络名称:[需要连接的无线网络的名字]

@echo.

@echo    -------------------------------------------

@echo           Powered By Young.Liu

@pause

@echo off

netsh wlan set profileparameter name=[需要连接的无线网络的名字] SSIDname=[需要连接的无线网络的名字] keyMaterial=[需要连接的无线网络的密码]

netsh wlan connect name=[需要连接的无线网络的名字] ssid=[需要连接的无线网络的名字]

netsh interface ip set address name="[无线网卡连接的名字]" source=static addr=[固定IP] mask=255.255.255.0 gateway=[固定网关]

------------------------------------------------------下面的是切换到外网--------------------------------------

@echo.

@echo    -------------------------------------------

@echo.

@echo     更改“无线链接”:动态获取IP地址

@echo     网络名称:[需要连接的无线网络的名字]

@echo.

@echo    -------------------------------------------

@echo           Powered By Young.Liu

@pause

@echo off

netsh wlan set profileparameter name=[需要连接的无线网络的名字] SSIDname=[需要连接的无线网络的名字] keyMaterial=[需要连接的无线网络的密码]

netsh wlan connect name=[需要连接的无线网络的名字]  ssid=[需要连接的无线网络的名字]

netsh interface ip set address name="[无线网卡连接的名字]" dhcp