keywords:windows7 ?bat自動(dòng)批處理改變IP地址、DNS和代理設(shè)置
?
改變IP地址設(shè)置:
@echo
off
netsh
interface
ipv4
set
address
"
無(wú)線網(wǎng)絡(luò)連接
"
static
192.168
.
100.200
255.255
.
255.0
192.168
.
100.1
netsh
interface
ipv4
set
dns name=
"
無(wú)線網(wǎng)絡(luò)連接
"
source=
static
addr=
8.8
.
4.4
netsh
interface
ipv4 add dns name=
"
無(wú)線網(wǎng)絡(luò)連接
"
addr=
61.177
.
7.1
index=
2
echo
------------------------------------------------------------------------------
echo
---------------------------------------------------------------------------------
echo
-----------------------------
?
?
改為DHPC(自動(dòng)獲?。┰O(shè)置:
@echo offf
netsh
interface
ipv4
set
address name=
"
無(wú)線網(wǎng)絡(luò)連接
"
source=
dhcp
netsh
interface
ipv4
set
dns name=
"
無(wú)線網(wǎng)絡(luò)連接
"
source=
dhcp
echo
------------------------------
?
?
開啟IE代理服務(wù)器設(shè)置:
@echo
off
title 自動(dòng)設(shè)置代理服務(wù)器
echo 正在設(shè)置代理服務(wù)器……
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 正在刷新設(shè)置……
ipconfig
/flushdns
?
?
關(guān)閉IE代理服務(wù)器設(shè)置:
@echo
off
title 自動(dòng)清除IE代理
echo 正在清空代理服務(wù)器設(shè)置……
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 代理服務(wù)器設(shè)置已經(jīng)清空
echo 正在刷新設(shè)置……
ipconfig
/
flushdns
?
?
批處理自動(dòng)選擇網(wǎng)絡(luò)設(shè)置全文
注:復(fù)制到記事本文件中,別存為,后綴改為”.bat”文件。在win7系統(tǒng)中運(yùn)行時(shí),會(huì)提示,“請(qǐng)求的操作需要提升為<作為管理員運(yùn)行>”;只需要在此bat文件上右擊“以管理員身份運(yùn)行”即可。
全文如下:
@echo
off
color 1f
title windows
7
多網(wǎng)絡(luò)環(huán)境自動(dòng)切換管理
echo.
echo
********************************************
echo
*** windows
7
雙網(wǎng)絡(luò)環(huán)寺自動(dòng)切換管理 ***
echo
*** 作者:王明洪 MSN:kswmh@hotmail.com ***
echo
********************************************
echo
*** 設(shè)置IP參數(shù),設(shè)置IE代理 ***
echo.
echo.
goto
menus
:menus
echo.
echo 請(qǐng)選擇:
echo.
echo
1
切換到家庭代理網(wǎng)絡(luò)
echo.
echo
2
切換到學(xué)校自動(dòng)獲取IP地址網(wǎng)絡(luò)。
echo.
echo
3
放棄設(shè)備,退出
echo.
set
/p
select
=
請(qǐng)輸入菜單對(duì)應(yīng)數(shù)字后回車:
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
"
無(wú)線網(wǎng)絡(luò)連接
"
echo 設(shè)置IP...設(shè)置網(wǎng)關(guān).....設(shè)置子網(wǎng)
netsh
interface
ipv4
set
address
"
無(wú)線網(wǎng)絡(luò)連接
"
static
192.168
.
100.200
255.255
.
255.0
192.168
.
100.1
echo 設(shè)置DNS...
netsh
interface
ipv4
set
dns name=
"
無(wú)線網(wǎng)絡(luò)連接
"
source=
static
addr=
8.8
.
4.4
netsh
interface
ipv4 add dns name=
"
無(wú)線網(wǎng)絡(luò)連接
"
addr=
61.177
.
7.1
index=
2
echo 設(shè)置IE代理...
echo 正在設(shè)置代理服務(wù)器……
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 正在刷新設(shè)置……
ipconfig
/
flushdns
goto
exit
:school
cls
echo 設(shè)置學(xué)校網(wǎng)絡(luò)自動(dòng)IP地址.
netsh
interface
ipv4
set
address name=
"
無(wú)線網(wǎng)絡(luò)連接
"
source=
dhcp
echo 設(shè)置DNS...
netsh
interface
ipv4
set
dns name=
"
無(wú)線網(wǎng)絡(luò)連接
"
source=
dhcp
echo 正在清除代理服務(wù)器設(shè)置……
echo 正在清空代理服務(wù)器設(shè)置……
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 代理服務(wù)器設(shè)置已經(jīng)清空
echo 正在刷新設(shè)置……
ipconfig
/
flushdns
goto
exit
:
exit
cls
echo.
cho.
echo.
echo.
echo.
echo
************
恭喜!網(wǎng)絡(luò)設(shè)置以完成。
echo.
echo.
echo.
echo.
echo.
echo.
pause
exit
?
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061
微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元

