Chinaunix首页 | 论坛 | 博客
  • 博客访问: 617192
  • 博文数量: 73
  • 博客积分: 1813
  • 博客等级: 上尉
  • 技术积分: 1213
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-27 19:59
文章分类
文章存档

2013年(1)

2012年(12)

2011年(28)

2010年(31)

2009年(1)

我的朋友

分类: 系统运维

2010-05-06 16:58:15

@echo off

 

echo 请输入你要选择的网段,2192.168.2.0/24网段,3192.168.3.0/24网段!

 

set /p Enter=请输入:

 

if "%Enter%"=="2" goto :setipaddress2

if "%Enter%"=="3" goto :setipaddress3

 

:setipaddress2

netsh interface ip set address "本地连接" static 192.168.2.45 255.255.255.0 192.168.2.1 1

goto :end

 

:setipaddress3

netsh interface ip set address "本地连接" static 192.168.3.45 255.255.255.0 192.168.3.1 1

goto :end

 

:end

echo 操作成功!

ipconfig

pause

 

将上面的代码copy到txt文档中,重命名为xxx.bat,双击执行即可!

阅读(1294) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~