返回首页

单位、公司、家庭不同网络自动切换网络设置bat文件

时间:2011-06-13 16:47来源:未知 作者:admin 点击:
@echo off @echo * @echo ** @echo *** @ ECHO 欢迎你,GISWIN!请您选择所需的网络设置: @ ECHO 1、家庭网络 2、公司网络 3、退出 @ ECHO ----------------------------------------------------------------------- set /p what=请输入选择项(1、2、3) if %what%==1 @ech
  
@echo off 
@echo *
@echo **
@echo ***
@ ECHO       欢迎你,GISWIN!请您选择所需的网络设置: 
@ ECHO 1、家庭网络 2、公司网络 3、退出
@ ECHO ----------------------------------------------------------------------- 

 
set /p what=请输入选择项(1、2、3) 
if %what%==1 @echo off
if %what%==1 echo 开始设置.... 
if %what%==1 echo 设置动态获取IP. 

 
if %what%==1 cmd /c netsh interface ip set address "本地连接" source=dhcp 
if %what%==1 echo 设置动态获取dns. 
if %what%==1 cmd /c netsh interface ip set dns "本地连接" source=dhcp 

 
if %what%==1 title 自动清除IE代理
 
if %what%==1 echo 正在清空代理服务器设置……
if %what%==1 reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
if %what%==1 reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "" /f
if %what%==1 reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d 0 /f

 
if %what%==1 echo 代理服务器设置已经清空

 
if %what%==1 echo 正在刷新设置……
if %what%==1 echo 恭喜!已完成所有设置. 

 
if %what%==2 echo 开始设置IP. 
if %what%==2 cmd /c netsh interface ip set address name="本地连接" source=static addr=128.2.*.* mask=255.255.0.0  
if %what%==2 @echo  开始设置代理服务器
if %what%==2 reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
if %what%==2 reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "128.2.*.*:808" /f
if %what%==2 reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "" /f
if %what%==2 echo 设置代理服务器成功!
if %what%==2 echo 恭喜!已完成所有设置. 
if %what%==2 pause 

 
if %what%==3 exit

 
总结网络方法,自己亲自写出。
已经验证通过,自己每天都在使用……

 

顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
最新评论 查看所有评论
发表评论 查看所有评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
推荐内容