您的位置:首页 > 理论基础 > 计算机网络

网络IP地址/MAC地址/网络代理一键设置脚本(自动配置)

2010-01-25 16:10 746 查看
网络IP地址/MAC地址/网络代理一键设置脚本... 一直在使用,却不敢独享,分享之...



@echo off

rem # ----------------------------------

rem # 接口 IP 配置

rem # ----------------------------------

echo ##########################################################

echo ##########################################################

echo ### ###

echo ### IP Fast Confion (C) CopyRight do2jiang.CSU. 2008.9 ###

echo ### ###

echo ##########################################################

echo ##########################################################

echo 选择"A"键,进行:自动获取IP地址及DNS配置

echo 选择"H"键,进行:浙江 Home 网络配置,号段:***.***.***.***

echo 选择"R"键,进行:RaiWay Lab网络配置,号段:192.168.118.157

echo 选择"M"键,进行:Min221 Lab网络配置,号段:192.168.10.61

echo 选择"N"键,进行:NetWork518网络配置,号段:218.196.73.52

echo 选择"L"键,进行:L Showing 5-115网络配置,号段:218.196.68.78

echo 选择"D"键,进行:Dormitory 网络配置,号段:218.196.91.155-》IE代理

echo 选择"T"键,进行:Tao 哥MAC 网络配置,号段:218.196.91.42 -》IE直连

echo 选择"G"键,进行:小 高MAC 网络配置,号段:218.196.91.186-》IE直连

echo 选择"W"键,进行:Work Place网络配置,号段:***.***.**.***

echo 选择"Q"键,退出程序

echo 请选择"D"或"H"或"R"或"M"或"D"或"W"或"G"或者"T"或者"N"或者"L"进行网络配置,回车确定:

set /p ch=

if %ch%=="" echo "You input null"&goto:EOF

set case=a,A,h,H,r,R,m,M,d,D,t,T,g,G,n,N,l,L,Q,q /w>nul

echo %case%|findstr "/<%ch%/>">nul&if errorlevel 1 goto:err

goto %ch%

goto err

::DHCP "dhcp自动获取IP地址"

:A

:a

echo "configure MAC,please wait 10 second ..."

::SKY的MAC

reg delete HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /f

reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /d 001d72289d62

@devcon disable *DEV_1693*

@devcon enable *DEV_1693*

reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyEnable /t reg_dword /d 000000000 /f

echo "configure ip address gateway,please wait 30 second ..."

@netsh int ip set address "本地连接" dhcp >nul

@netsh int ip set dns "本地连接" dhcp >nul

echo ip configure is done

goto : EOF

::home

:H

:h

::"Config IP of Home"

echo "configure MAC,please wait 10 second ..."

::SKY的MAC

reg delete HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /f

reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /d 001d72289d62

@devcon disable *DEV_1693*

@devcon enable *DEV_1693*

reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyEnable /t reg_dword /d 000000000 /f

echo "configure ip address gateway,please wait 30 second ..."

@netsh int ip set address "本地连接" static 10.51.139.18 255.0.0.0 10.51.139.1 1 >nul

@netsh int ip set dns "本地连接" static 10.51.139.1 PRIMARY >nul

echo ip configure is done

goto : EOF

::铁道513实验室

:R

:r

::"Config IP of RailWay.Lab"

echo "configure MAC,please wait 10 second ..."

::SKY的MAC

reg delete HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /f

reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /d 001d72289d62

@devcon disable *DEV_1693*

@devcon enable *DEV_1693*

echo "configure ip address gateway,please wait 30 second ..."

@netsh interface ip set address name="本地连接" source=static addr=192.168.118.157 mask=255.255.255.0

@netsh interface ip set address name="本地连接" gateway=192.168.118.3 gwmetric=0

@netsh interface ip set dns name="本地连接" source=static addr=202.197.64.6 register=PRIMARY

@netsh interface ip add dns name="本地连接" addr=202.103.96.112 index=2

@netsh interface ip set wins name="本地连接" source=static addr=none

reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyEnable /t reg_dword /d 000000000 /f

::静态映射

@echo on

arp -s 192.168.118.3 00-13-46-69-ee-72

@echo off

ipconfig

echo ip configure is done

goto : EOF

::民主楼221实验室

:M

:m

::"Config IP of Min221.Lab"

echo "configure MAC,please wait 10 second ..."

::SKY的MAC

reg delete HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /f

reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /d 001d72289d62

@devcon disable *DEV_1693*

@devcon enable *DEV_1693*

reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyEnable /t reg_dword /d 000000000 /f

echo "configure ip address gateway,please wait 30 second ..."

@netsh interface ip set address name="本地连接" source=static addr=192.168.10.61 mask=255.255.255.0

@netsh interface ip set address name="本地连接" gateway=192.168.10.1 gwmetric=0

@netsh interface ip set dns name="本地连接" source=static addr=202.197.64.6 register=PRIMARY

@netsh interface ip add dns name="本地连接" addr=202.103.96.112 index=2

@netsh interface ip set wins name="本地连接" source=static addr=none

::静态映射

::arp -s 192.168.118.3 00-e0-4c-b3-28-90

ipconfig

echo ip configure is done

goto : EOF

::本部十舍518寝室--NetWork518

:N

:n

echo "configure MAC,please wait 10 second ..."

::SKY的MAC

@reg delete HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /f

@reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /d 001d72289d62

@devcon disable *DEV_1693*

@devcon enable *DEV_1693*

::"Config IP for NetWork 518"

echo "configure ip address gateway,please wait 30 second ..."

@netsh interface ip set address name="本地连接" source=static addr=218.196.73.52 mask=255.255.255.0

@netsh interface ip set address name="本地连接" gateway=218.196.73.254 gwmetric=0

@netsh interface ip set dns name="本地连接" source=static addr=202.197.64.6 register=PRIMARY

@netsh interface ip add dns name="本地连接" addr=202.103.96.68 index=2

@netsh interface ip set wins name="本地连接" source=static addr=none

echo ip configure is done



echo “用户名:a0105183s”

echo ”密码:XXX


goto : EOF

::115

:L

:l

echo "configure MAC,please wait 10 second ..."

::SKY的MAC

@reg delete HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /f

@reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /d 0019660e0782

@devcon disable *DEV_1693*

@devcon enable *DEV_1693*

::"Config IP for NetWork 518"

echo "configure ip address gateway,please wait 30 second ..."

@netsh interface ip set address name="本地连接" source=static addr=218.196.68.78 mask=255.255.255.0

@netsh interface ip set address name="本地连接" gateway=218.196.68.254 gwmetric=0

@netsh interface ip set dns name="本地连接" source=static addr=202.197.64.6 register=PRIMARY

@netsh interface ip add dns name="本地连接" addr=202.103.96.68 index=2

@netsh interface ip set wins name="本地连接" source=static addr=none

echo ip configure is done



echo "用户名:a0051153s"

echo "密 码:XXX
"

goto : EOF

::本部十舍518寝室--代理

:D

:d

::"Config IP of Dormitory "

echo "configure MAC,please wait 10 second ..."

::SKY的MAC

reg delete HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /f

reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /d 001d72289d62

@devcon disable *DEV_1693*

@devcon enable *DEV_1693*

echo "configure ip address gateway,please wait 30 second ..."

@netsh interface ip set address name="本地连接" source=static addr=218.196.91.157 mask=255.255.255.0

::删除网关

@netsh interface ip delete address "本地连接" gateway=all

::设置局域网代理

set ProxyServerValue=ftp=218.196.91.42:808;http=218.196.91.42:808;https=218.196.91.42:808;socks=218.196.91.42:1080

reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyServer /t reg_sz /d %ProxyServerValue% /f

reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyEnable /t reg_dword /d 000000001 /f

echo ip configure is done

goto : EOF

::本部十舍518寝室--代理(突破代理禁用)

:C

:c

::"Config IP of Dormitory "

echo "configure MAC,please wait 10 second ..."

::Tao哥的MAC

reg delete HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /f

reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /d 00508d6a023e

@devcon disable *DEV_1693*

@devcon enable *DEV_1693*

echo "configure ip address gateway,please wait 30 second ..."

@netsh interface ip set address name="本地连接" source=static addr=218.196.91.157 mask=255.255.255.0

::删除网关

@netsh interface ip delete address "本地连接" gateway=all

::设置局域网代理

set ProxyServerValue=ftp=218.196.91.42:808;http=218.196.91.42:808;https=218.196.91.42:808;socks=218.196.91.42:1080

reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyServer /t reg_sz /d %ProxyServerValue% /f

reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyEnable /t reg_dword /d 000000001 /f

echo ip configure is done

goto : EOF

::本部十舍518寝室--Tao哥MAC直连

:T

:t

::"Config MAC of Tao哥"

echo "configure ip address gateway,please wait 30 second ..."

@netsh interface ip set address name="本地连接" source=static addr=218.196.91.42 mask=255.255.255.0

@netsh interface ip set address name="本地连接" gateway=218.196.91.254 gwmetric=0

@netsh interface ip set dns name="本地连接" source=static addr=202.197.64.6 register=PRIMARY

@netsh interface ip add dns name="本地连接" addr=202.103.96.68 index=2

@netsh interface ip set wins name="本地连接" source=static addr=none

reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyEnable /t reg_dword /d 000000000 /f

::涛哥的MAC

reg delete HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /f

reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /d 00508d6a023e

devcon disable *DEV_1693*

devcon enable *DEV_1693*

echo MAC configure is done

echo "用户名:a0105182s"

echo "密 码:XXXX
"

goto : EOF

::本部十舍518寝室--小高MAC直连

:G

:g

::"Config MAC of Tao哥"

echo "configure ip address gateway,please wait 30 second ..."

@netsh interface ip set address name="本地连接" source=static addr=218.196.91.186 mask=255.255.255.0

@netsh interface ip set address name="本地连接" gateway=218.196.91.254 gwmetric=0

@netsh interface ip set dns name="本地连接" source=static addr=202.197.64.6 register=PRIMARY

@netsh interface ip add dns name="本地连接" addr=202.103.96.68 index=2

@netsh interface ip set wins name="本地连接" source=static addr=none

reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyEnable /t reg_dword /d 000000000 /f

::小高的MAC

reg delete HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /f

reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /d 001617169e73

devcon disable *DEV_1693*

devcon enable *DEV_1693*

echo MAC configure is done

echo "用户名:a0105181s"

echo "密 码:xxxx
"

goto : EOF

::工作单位

:W

:w

::"Config IP of work intranet"

echo "configure MAC,please wait 10 second ..."

::SKY的MAC

reg delete HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /f

reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002bE10318}/0014 /v NetworkAddress /d 001d72289d62

@devcon disable *DEV_1693*

@devcon enable *DEV_1693*

reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyEnable /t reg_dword /d 000000000 /f

echo "configure ip address gateway,please wait 30 second ..."

@netsh int ip set address "本地连接" static 192.168.1.118 255.255.255.0 192.168.1.1 1 >nul

@netsh int ip set dns "本地连接" static 192.168.1.1 PRIMARY >nul

echo ip configure is done

goto : EOF

::------------------------------------------ QUIT -------------------------------

:q

:Q

goto : EOF

::错误输入

:err

::"error"

echo your input "%ch%" , no this argument!

game over!

goto : EOF
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: