【朋乐信息技术】如何快速设置IP地址,用批处理文件设置IP地址
2014-05-18 12:02
246 查看
【背景】
到不同办公地点需要切换不同IP地址,每次手工修改IP还是比较麻烦,如果能通过点击一个按钮就能快速切换IP地址,这样就方便很多了;
【改善方案】
原理:通过设置批处理文件来快速切换IP地址;
样板:
从上图可以看到,每次我换不同地方的时候,只要点击对应的批处理文件就可以很方便的切换IP地址了;
【代码】
自动获取ip.bat对应的代码====================
netsh interface ip set address "本地连接 2" dhcp
netsh interface ip set dns "本地连接 2" dhcp
=======================================
天津海格ip.bat对应的代码====================
netsh interface ip set address name="本地连接 2" source=static addr=192.168.102.40 mask=255.255.255.0
netsh interface ip set address name="本地连接 2" gateway=192.168.102.254 gwmetric=0
netsh interface ip set dns name="本地连接 2" source=static addr=202.99.96.68 register=PRIMARY
netsh interface ip add dns "本地连接 2" 202.99.104.68
=======================================
================================================================
以上信息由广东省惠州朋乐信息技术有限公司提供,请转载时保留公司信息,谢谢!
作者:张工
公司网址:www.plee.com.cn
公司邮箱:xyu.z@plee.com.cn
QQ:2433328556
微博:http://t.qq.com/penglezhanggong
工作简介:提供企业信息化整体解决方案。
业务范围:制造业MES系统开发和实施
================================================================
到不同办公地点需要切换不同IP地址,每次手工修改IP还是比较麻烦,如果能通过点击一个按钮就能快速切换IP地址,这样就方便很多了;
【改善方案】
原理:通过设置批处理文件来快速切换IP地址;
样板:
从上图可以看到,每次我换不同地方的时候,只要点击对应的批处理文件就可以很方便的切换IP地址了;
【代码】
自动获取ip.bat对应的代码====================
netsh interface ip set address "本地连接 2" dhcp
netsh interface ip set dns "本地连接 2" dhcp
=======================================
天津海格ip.bat对应的代码====================
netsh interface ip set address name="本地连接 2" source=static addr=192.168.102.40 mask=255.255.255.0
netsh interface ip set address name="本地连接 2" gateway=192.168.102.254 gwmetric=0
netsh interface ip set dns name="本地连接 2" source=static addr=202.99.96.68 register=PRIMARY
netsh interface ip add dns "本地连接 2" 202.99.104.68
=======================================
================================================================
以上信息由广东省惠州朋乐信息技术有限公司提供,请转载时保留公司信息,谢谢!
作者:张工
公司网址:www.plee.com.cn
公司邮箱:xyu.z@plee.com.cn
QQ:2433328556
微博:http://t.qq.com/penglezhanggong
工作简介:提供企业信息化整体解决方案。
业务范围:制造业MES系统开发和实施
================================================================
相关文章推荐
- 用批处理文件(bat)设置IP地址
- Window批处理文件设置ip地址
- 如何在Webstorm/Phpstorm中设置连接FTP,并快速进行文件比较,上传下载,同步等操作
- 如何在Webstorm/Phpstorm中设置连接FTP,并快速进行文件比较,上传下载,同步等操作(远程开发)
- 如何在Webstorm/Phpstorm中设置连接FTP,并快速进行文件比较,上传下载,同步等操作
- Windows 2003如何批量绑定IP地址?批量添加ip地址,一行DOS命令快速设置
- 如何在Webstorm/Phpstorm中设置连接FTP,并快速进行文件比较,上传下载,同步等操作
- 如何快速设置IP地址
- 如何在Webstorm/Phpstorm中设置连接FTP,并快速进行文件比较,上传下载,同步等操作
- 自动设置IP地址的批处理文件
- 如何在Webstorm/Phpstorm中设置连接FTP,并快速进行文件比较,上传下载,同步等操作
- 如何在Webstorm/Phpstorm中设置连接FTP,并快速进行文件比较,上传下载,同步等操作
- win8文件视图一键同步如何设置以便快速找到某个文件
- 用批处理文件轻松设置、更改IP地址
- 如何在Phpstorm中设置FTP,并快速进行文件比较,上传下载,同步等操作
- 如何在Webstorm/Phpstorm中设置连接FTP,并快速进行文件比较,上传下载,同步等操作
- 【在Windows xp/7下快速设置IP地址的批处理代码】
- 采用批处理文件快速动态修改IP地址,默认网关和DNS
- 使用批处理文件,自动设置计算机IP地址