概念上就是
所以你電腦應該是
如果是新增就(-p是永久的意思,測試的時候可以先不要-p,開機就會復原)
route -p add 192.168.1.0 MASK 255.255.255.0 192.168.1.254 metric 10
如果是刪除就
route -p delete 192.168.5.0 MASK 255.255.255.0 192.168.3.250 metric 10
提供WIFI的方式 動手搜一下很快的
rem 要連接的wifi名稱
set wifi_name=mywifi
set log_file=wifi.log
set try_cnt=1
rem 如果有參數1,就將參數1指定為wifi名稱
if [%1] == [] (echo default_wifi>nul) || (
set wifi_name=%1
)
echo [%date% %time%] Start connect wifi:%wifi_name% >>%log_file%
rem
:mainloop
(netsh WLAN show interfaces | findStr %wifi_name% >nul && (
echo already connected.
)) || (
set /a try_cnt+=1
echo [%date% %time%] try to connect...[%try_cnt%]
echo [%date% %time%] try to connect...[%try_cnt%] >>%log_file%
netsh wlan connect ssid=%wifi_name% name=%wifi_name% >>%log_file%
)
choice /t 5 /d y /n >nul
goto mainloop