随笔-143  评论-68  文章-0  trackbacks-0

@echo off
rem eth
set eth="本地连接"
rem ip
set ip=192.168.0.8
rem gw
set gw=192.168.0.254
rem netmasks
set netmasks=255.255.255.0

echo 正在将本机IP更改到: %ip%
rem
if %gw%==none netsh interface ip set address %eth% static %ip% %netmasks% %gw% > nul
if not %gw%==none netsh interface ip set address %eth% static %ip% %netmasks% %gw% 1 > nul
echo.........................
echo 检查当前本机IP:
ipconfig
echo.........................
echo 成功将本机IP更改为%ip%!
pause
close


然后把以上内容保存在一个txt文档中,然后将后缀名修改为bat即可。
可以根据自己的需要调整。

posted on 2007-11-17 15:58 windone 阅读(1299) 评论(2)  编辑 收藏 引用 所属分类: 计算机软件

评论:
# re: 使用批处理命令修改IP地址,比较实用 2007-11-22 14:05 | 国际长途电话卡
HOHO,非常实用!  回复  更多评论
  
# re: 使用批处理命令修改IP地址,比较实用 2008-09-03 10:53 | stoneman
好  回复  更多评论
  
只有注册用户登录后才能发表评论。
<2008年6月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

随笔分类(156)

随笔档案(143)

测试网站

积分与排名

  • 积分 - 224728
  • 排名 - 24

阅读排行榜