Chinaunix首页 | 论坛 | 博客
  • 博客访问: 93771
  • 博文数量: 23
  • 博客积分: 2000
  • 博客等级: 大尉
  • 技术积分: 205
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-12 12:22
文章分类

全部博文(23)

文章存档

2009年(3)

2008年(20)

我的朋友

分类: WINDOWS

2009-01-08 09:52:41

netsh   interface   ip   dump   >ip.txt 

/**
 @file setip.bat
 @brief set ip by customer's choise, 1-static, 2-dhcp
 @author xiaoxf
 @version 1.0
 @date 2009-01-08
 */

///setip.bat start---------------------------------------------
@echo off
echo set ip
set /p type=请选择设置方式,1-静态,2-DHCP(1,2):
if /i %type%==1 goto :STATIC_IP
if /i %type%==2 goto :DHCP_IP


:STATIC_IP
netsh interface ip set address name="本地连接" source=static addr=192.168.71.100 mask=255.255.255.0
netsh interface ip set address name="本地连接" gateway=192.168.71.1 gwmetric=0
netsh interface ip set dns name="本地连接" source=static addr=61.154.22.41 register=PRIMARY
ipconfig
pause
exit

:DHCP_IP
netsh interface ip set address name="本地连接" source=dhcp
netsh interface ip set dns name="本地连接" source=dhcp register=PRIMARY
netsh interface ip set wins name="本地连接" source=dhcp
ipconfig
pause
exit
///setip.bat end-----------------------------------------------

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