windows7 bat自动批处理改变IP地址、DNS和代理设置
2011-06-30 10:30
357 查看
windows7 bat自动批处理改变IP地址、DNS和代理设置
改变IP地址设置:
@echo off
netsh interface ipv4 set address "无线网络连接" static 192.168.100.200
255.255.255.0 192.168.100.1
netsh interface ipv4 set dns name="无线网络连接" source=static addr=8.8.4.4
netsh interface ipv4 add dns name="无线网络连接" addr=61.177.7.1 index=2
echo
------------------------------------------------------------------------------
echo
---------------------------------------------------------------------------------
echo -----------------------------
改为DHPC(自动获取)设置:
@echo offf
netsh interface ipv4 set address
name="无线网络连接"
source=dhcp
netsh interface ipv4 set dns name="无线网络连接" source=dhcp
echo------------------------------
开启IE代理服务器设置:
@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 "192.168.100.100:808" /f
reg add
"HKCU/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v
ProxyOverride /t REG_SZ /d "" /f
echo 正在刷新设置……
ipconfig /flushdns
关闭IE代理服务器设置:
@echo off
title 自动清除IE代理
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
批处理自动选择网络设置全文
注:复制到记事本文件中,别存为,后缀改为”.bat”文件。在win7系统中运行时,会提示,“请求的操作需要提升为<作为管理员运行>”;只需要在此bat文件上右击“以管理员身份运行”即可。
全文如下:
@echo
off
color 1f
title
windows 7 多网络环境自动切换管理
echo.
echo ********************************************
echo *** windows 7 双网络环寺自动切换管理 ***
echo *** 作者:王明洪 MSN:kswmh@hotmail.com ***
echo ********************************************
echo *** 设置IP参数,设置IE代理 ***
echo.
echo.
goto
menus
:menus
echo.
echo 请选择:
echo.
echo 1
切换到家庭代理网络
echo.
echo 2
切换到学校自动获取IP地址网络。
echo.
echo 3
放弃设备,退出
echo.
set /p
select=请输入菜单对应数字后回车:
if /i
"%select%" == "1" goto home
if /i
"%select%" == "2" goto school
if /i
"%select%" == "3" exit
goto
menus
:home
cls
netsh
interface ip reset "无线网络连接"
echo 设置IP...设置网关.....设置子网
netsh
interface ipv4 set address "无线网络连接" static 192.168.100.200 255.255.255.0 192.168.100.1
echo 设置DNS...
netsh
interface ipv4 set dns name="无线网络连接" source=static addr=8.8.4.4
netsh
interface ipv4 add dns name="无线网络连接" addr=61.177.7.1 index=2
echo 设置IE代理...
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 "192.168.100.100:808" /f
reg
add "HKCU/Software/Microsoft/Windows/CurrentVersion/Internet
Settings" /v ProxyOverride /t REG_SZ /d "" /f
echo 正在刷新设置……
ipconfig
/flushdns
goto
exit
:school
cls
echo 设置学校网络自动IP地址.
netsh
interface ipv4 set address name="无线网络连接" source=dhcp
echo 设置DNS...
netsh
interface ipv4 set dns name="无线网络连接" source=dhcp
echo 正在清除代理服务器设置……
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
goto
exit
:exit
cls
echo.
cho.
echo.
echo.
echo.
echo
************恭喜!网络设置以完成。
echo.
echo.
echo.
echo.
echo.
echo.
pause
exit
改变IP地址设置:
@echo off
netsh interface ipv4 set address "无线网络连接" static 192.168.100.200
255.255.255.0 192.168.100.1
netsh interface ipv4 set dns name="无线网络连接" source=static addr=8.8.4.4
netsh interface ipv4 add dns name="无线网络连接" addr=61.177.7.1 index=2
echo
------------------------------------------------------------------------------
echo
---------------------------------------------------------------------------------
echo -----------------------------
改为DHPC(自动获取)设置:
@echo offf
netsh interface ipv4 set address
name="无线网络连接"
source=dhcp
netsh interface ipv4 set dns name="无线网络连接" source=dhcp
echo------------------------------
开启IE代理服务器设置:
@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 "192.168.100.100:808" /f
reg add
"HKCU/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v
ProxyOverride /t REG_SZ /d "" /f
echo 正在刷新设置……
ipconfig /flushdns
关闭IE代理服务器设置:
@echo off
title 自动清除IE代理
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
批处理自动选择网络设置全文
注:复制到记事本文件中,别存为,后缀改为”.bat”文件。在win7系统中运行时,会提示,“请求的操作需要提升为<作为管理员运行>”;只需要在此bat文件上右击“以管理员身份运行”即可。
全文如下:
@echo
off
color 1f
title
windows 7 多网络环境自动切换管理
echo.
echo ********************************************
echo *** windows 7 双网络环寺自动切换管理 ***
echo *** 作者:王明洪 MSN:kswmh@hotmail.com ***
echo ********************************************
echo *** 设置IP参数,设置IE代理 ***
echo.
echo.
goto
menus
:menus
echo.
echo 请选择:
echo.
echo 1
切换到家庭代理网络
echo.
echo 2
切换到学校自动获取IP地址网络。
echo.
echo 3
放弃设备,退出
echo.
set /p
select=请输入菜单对应数字后回车:
if /i
"%select%" == "1" goto home
if /i
"%select%" == "2" goto school
if /i
"%select%" == "3" exit
goto
menus
:home
cls
netsh
interface ip reset "无线网络连接"
echo 设置IP...设置网关.....设置子网
netsh
interface ipv4 set address "无线网络连接" static 192.168.100.200 255.255.255.0 192.168.100.1
echo 设置DNS...
netsh
interface ipv4 set dns name="无线网络连接" source=static addr=8.8.4.4
netsh
interface ipv4 add dns name="无线网络连接" addr=61.177.7.1 index=2
echo 设置IE代理...
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 "192.168.100.100:808" /f
reg
add "HKCU/Software/Microsoft/Windows/CurrentVersion/Internet
Settings" /v ProxyOverride /t REG_SZ /d "" /f
echo 正在刷新设置……
ipconfig
/flushdns
goto
exit
:school
cls
echo 设置学校网络自动IP地址.
netsh
interface ipv4 set address name="无线网络连接" source=dhcp
echo 设置DNS...
netsh
interface ipv4 set dns name="无线网络连接" source=dhcp
echo 正在清除代理服务器设置……
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
goto
exit
:exit
cls
echo.
cho.
echo.
echo.
echo.
echo
************恭喜!网络设置以完成。
echo.
echo.
echo.
echo.
echo.
echo.
pause
exit
相关文章推荐
- 用批处理(.BAT)自动设置IP地址、子网掩码、网关、DNS
- 用批处理(.BAT)自动设置计算机名IP地址DNS
- 批处理、VBS实现自动设置IP、默认网关、DNS、WINS、IE代理!
- windows下用bat命令自动设置ip地址和dns
- 使用 bat 自动设置IP地址和自动获取IP地址
- 使用批处理命令设置windows系统的ip地址和dns附图
- 使用批处理命令设置windows系统的ip地址和dns
- 使用批处理命令设置windows系统的ip地址和dns
- 自动设置IP地址的BAT
- 批处理脚本设置本地连接IP地址和DNS
- 使用批处理文件,自动设置计算机IP地址
- 自动设置IP地址的批处理
- DNS、DHCP的备份恢复bat(批处理自动实现)
- 批处理、VBS实现自动设置IP、默认网关、DNS、WINS、IE代理!(一)
- 自动设置IP地址的批处理文件
- 使用批处理文件,自动设置计算机IP地址
- win7 批处理自动 修改本地IP地址、无线IP地址.bat
- 批处理、VBS实现自动设置IP、默认网关、DNS、WINS、IE代理!(二)
- win7 批处理自动 修改本地IP地址、无线IP地址.bat
- 使用批处理文件,自动设置计算机IP地址