日期:2014-05-17  浏览次数:20669 次

windows IE 代理 bat

用bat脚本设置代理

?

?

@echo off
title 自动设置代理服务器

echo 正在设置代理服务器……
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 "9.181.193.205:80" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "" /f

echo 正在刷新设置……
ipconfig /flushdns

?

清空代理设置

?

?

echo 正在清空代理服务器设置……
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 "" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d 0 /f

echo 代理服务器设置已经清空

echo 正在刷新设置……
ipconfig /flushdns

?

?

注意是英文的引号.

?

win7和XP都可以使用.

?

?

IP自动获取

?

netsh interface ip set address name="本地连接" source=dhcp
netsh interface ip set dns name="本地连接" source=dhcp

?

设置IP/子网掩码/网关

?

netsh interface ip set address 本地连接 static 220.220.215.17 255.255.255.0 220.220.215.254

?

其中的"本地连接" 是机器上的连接名称

1 楼 congdepeng 2011-04-20  
不错,因为公司和客户现场2边跑,我经常需要设置代理。。谢谢
2 楼 getclass 2011-05-10  
congdepeng 写道
不错,因为公司和客户现场2边跑,我经常需要设置代理。。谢谢

大家都一样 呵呵