ip切换脚本

来源:互联网 发布:贵州大数据是什么 编辑:程序博客网 时间:2024/05/20 04:15

现在网上下载的ip切换工具都喜欢挂点小尾巴,不是加广告就是加病毒,还是自己写的脚本安全放心。

@echo off 
color 0a 
title IP切换脚本-Create by cory@ans.com 
:start 


@echo --------------------------------- 
@echo 请选择你现在的位置: 
@echo 1.auto(启用DHCP) 
@echo 2.ans(固定IP) 
@echo --------------------------------- 
set /p sLocal=请选择: 
if %sLocal%==1 goto auto 
if %sLocal%==2 goto ans
cls 
@echo 选择错误,请重新选择 


goto start 
:auto 
@echo 正在设置有线连接为DHCP模式 
netsh interface ip set address 本地连接 dhcp
netsh interface ip set dns 本地连接 source=dhcp
goto end 


:ans 
@echo 正在设置有线连接为固定IP:x.x.x.x 

@echo netsh interface ip set address 本地连接 static x.x.x.x x.x.x.x x.x.x.x

@echo netsh interface ip set dns 本地连接 x.x.x.x

@echo netsh interface ip add dns 本地连接 x.x.x.x index=2



:end 
echo 设置完成! 
pause

0 0
原创粉丝点击