您的位置:首页 > 理论基础 > 计算机网络

切换家里和公司网络的脚本

2011-03-08 13:36 148 查看
@echo off
echo (1).家庭网络
echo (2).办公网络
echo (3).退出
set /p x= 选择你要设置的网络:
if %x%==1 goto a
if %x%==2 goto b
if %x%==3 goto c
:a
netsh interface ip set address "本地连接" static 192.168.0.254 255.255.255.0 192.168.0.1 1
netsh interface ip set dns "本地连接" static 8.8.8.8
netsh interface ip add dns "本地连接" 8.8.4.4
echo 开始清楚IE代理设置
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "168.1.255.251:80" /f
exit
:b
netsh interface ip set address "本地连接" static 168.1.110.210 255.255.255.0 168.1.110.254 1
netsh interface ip set dns "本地连接" static 168.1.255.251
echo 开始设置IE代理上网
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "168.1.255.251:80" /f
exit
:c exit
保存为 切换ip.bat,双击执行即可.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: