手机
当前位置:查字典教程网 >脚本专栏 >DOS/BAT >ip地址切换批处理脚本分享
ip地址切换批处理脚本分享
摘要:复制代码代码如下:@echooffrem#----------------------------------rem#接口IP配置rem#-...

复制代码 代码如下:

@echo off

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

rem # 接口 IP 配置

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

echo "=========IP 控制管理=========="

echo "=> d: 自动获取IP"

echo "=> h: 寝室 IP地址:66.168.1.8"

echo "=> r: 公司网络 IP地址:192.168.250.173"

echo "请输入对应的序号d,h,r,按回车键结束: "

set /p ch=

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

set case=d,h,t,w>nul

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

goto %ch%

goto err

:h

:: "寝室"

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

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

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

echo home ip configure is done

goto :EOF

:r

:: "公司网络"

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

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

echo transport ip configure is done

goto :EOF

:d

:DHCP "自动获取IP地址"

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

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

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

:err

:: "error"

echo your input "%ch%" ,no this argument ! please input h or w! game over

rem # 接口 IP 配置结束

【ip地址切换批处理脚本分享】相关文章:

批处理随机取值练习代码

批处理蠕虫bat

批处理 远程控制

QQ多帐号自动登录批处理脚本

一个小助手批处理实例代码

可以实现反复重启的批处理

批处理设置文件访问权限的方法分享

安静运行批处理的vbs脚本

Win2003设置IP安全策略批处理脚本

Ip安全策略批处理脚本及注释(netsh)

精品推荐
分类导航