windows7 bat自动批处理改变IP地址、DNS和代理设置
来源:互联网 发布:如何参加淘宝试用 编辑:程序博客网 时间:2024/06/06 04:30
windows7 bat自动批处理改变IP地址、DNS和代理设置
改变IP地址设置:
@echo off
netsh interface ipv4 set address "无线网络连接" static 192.168.100.200255.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 addressname="无线网络连接"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" /vProxyEnable /t REG_DWORD /d 1 /f
reg add"HKCU/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /vProxyServer /d "192.168.100.100:808" /f
reg add"HKCU/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /vProxyOverride /t REG_SZ /d "" /f
echo 正在刷新设置……
ipconfig /flushdns
关闭IE代理服务器设置:
@echo off
title 自动清除IE代理
echo 正在清空代理服务器设置……
reg add"HKCU/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /vProxyEnable /t REG_DWORD /d 0 /f
reg add"HKCU/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /vProxyServer /d "" /f
reg add"HKCU/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /vProxyOverride /t REG_SZ /d 0 /f
echo 代理服务器设置已经清空
echo 正在刷新设置……
ipconfig /flushdns
批处理自动选择网络设置全文
注:复制到记事本文件中,别存为,后缀改为”.bat”文件。在win7系统中运行时,会提示,“请求的操作需要提升为<作为管理员运行>”;只需要在此bat文件上右击“以管理员身份运行”即可。
全文如下:
@echooff
color 1f
titlewindows 7 多网络环境自动切换管理
echo.
echo ********************************************
echo *** windows 7 双网络环寺自动切换管理 ***
echo *** 作者:王明洪 MSN:kswmh@hotmail.com ***
echo ********************************************
echo *** 设置IP参数,设置IE代理 ***
echo.
echo.
gotomenus
:menus
echo.
echo 请选择:
echo.
echo 1切换到家庭代理网络
echo.
echo 2切换到学校自动获取IP地址网络。
echo.
echo 3放弃设备,退出
echo.
set /pselect=请输入菜单对应数字后回车:
if /i"%select%" == "1" goto home
if /i"%select%" == "2" goto school
if /i"%select%" == "3" exit
gotomenus
:home
cls
netshinterface ip reset "无线网络连接"
echo 设置IP...设置网关.....设置子网
netshinterface ipv4 set address "无线网络连接" static 192.168.100.200 255.255.255.0 192.168.100.1
echo 设置DNS...
netshinterface ipv4 set dns name="无线网络连接" source=static addr=8.8.4.4
netshinterface ipv4 add dns name="无线网络连接" addr=61.177.7.1 index=2
echo 设置IE代理...
echo 正在设置代理服务器……
regadd "HKCU/Software/Microsoft/Windows/CurrentVersion/InternetSettings" /v ProxyEnable /t REG_DWORD /d 1 /f
regadd "HKCU/Software/Microsoft/Windows/CurrentVersion/InternetSettings" /v ProxyServer /d "192.168.100.100:808" /f
regadd "HKCU/Software/Microsoft/Windows/CurrentVersion/InternetSettings" /v ProxyOverride /t REG_SZ /d "" /f
echo 正在刷新设置……
ipconfig/flushdns
gotoexit
:school
cls
echo 设置学校网络自动IP地址.
netshinterface ipv4 set address name="无线网络连接" source=dhcp
echo 设置DNS...
netshinterface ipv4 set dns name="无线网络连接" source=dhcp
echo 正在清除代理服务器设置……
echo 正在清空代理服务器设置……
regadd "HKCU/Software/Microsoft/Windows/CurrentVersion/InternetSettings" /v ProxyEnable /t REG_DWORD /d 0 /f
regadd "HKCU/Software/Microsoft/Windows/CurrentVersion/InternetSettings" /v ProxyServer /d "" /f
regadd "HKCU/Software/Microsoft/Windows/CurrentVersion/InternetSettings" /v ProxyOverride /t REG_SZ /d 0 /f
echo 代理服务器设置已经清空
echo 正在刷新设置……
ipconfig/flushdns
gotoexit
:exit
cls
echo.
cho.
echo.
echo.
echo.
echo************恭喜!网络设置以完成。
echo.
echo.
echo.
echo.
echo.
echo.
pause
exit
- windows7 bat自动批处理改变IP地址、DNS和代理设置
- 使用bat批处理脚本自动设置IP和IE代理
- Windows 7系统BAT批处理修改IP地址和DNS
- windows下用bat命令自动设置ip地址和dns
- 设置IP和代理,dns的Windows Bat脚本
- 批处理脚本bat设置IP地址
- 批处理、VBS实现自动设置IP、默认网关、DNS、WINS、IE代理!
- 使用 bat 自动设置IP地址和自动获取IP地址
- 自动设置IP地址的BAT
- 使用批处理命令设置windows系统的ip地址和dns
- 一键设置网络IP地址的bat批处理
- [BAT]批处理修改IP地址
- [BAT]批处理修改IP地址
- [BAT]批处理修改IP地址
- win7 批处理自动 修改本地IP地址、无线IP地址.bat
- 批处理bat设置网络IP
- bat设置ip、dns、dhcp
- BAT脚本设置IP DNS
- ARM程序组成
- 项目管理手记(30):ERP系统应用中的绩效杠杆
- Bigtable:一个分布式的结构化数据存储系统
- jexcel 应用实例
- 关于|Image$$RO$$Limit||Image$$RW$$Base||Image$$ZI$$Ba|
- windows7 bat自动批处理改变IP地址、DNS和代理设置
- DXUT框架剖析(1)
- 继承机制的作用,Javascript继承机制的设计思想
- Struts2和Spring整合
- ADS1.2连接器使用手册 有|Image$$RO$$Limit|等说明
- DXUT框架剖析(2)
- The Google File System中文版
- CMenu创建弹出菜单
- ARMLink使用方法详解