找回密码
 注-册

QQ登录

只需一步,快速开始

查看: 1557|回复: 0

[操作技巧] 利用批处理自动填写ip

[复制链接]
Leya 发表于 2008-5-3 00:44:02 | 显示全部楼层 |阅读模式
  1. 以下为自动填写ip


  2. @echo off

  3. echo This is the begin..
  4. echo Set IP Address..

  5. netsh interface ip set address name="本地连接" source=static addr=192.168.0.2 mask=255.255.255.0

  6. rem 设置本地连接的ip地址为:192.168.0.22,子网掩码为:255.255.255.0
  7. echo set  Mask and Gateway..

  8. netsh interface ip set address name="本地连接" gateway=192.168.0.1 gwmetric=0

  9. rem 设置网关

  10. netsh interface ip set dns name="本地连接" source=static addr=202.102.154.33 register=PRIMARY

  11. echo set First DNS
  12. rem 设置主dns

  13. netsh interface ip add dns name="本地连接" addr=202.102.134.68
  14. echo set Second DNS
  15. rem 设置备份dns

  16. netsh interface ip set wins name="本地连接" source=static addr=none

  17. rem 设置wins

  18. echo This is the ending..



  19. 以下为自动设置成自动获取

  20. @echo off

  21. echo This is the begin..

  22. netsh interface ip set address name="本地连接" source=dhcp

  23. netsh interface ip set dns name="本地连接" source=dhcp register=PRIMARY

  24. netsh interface ip set wins name="本地连接" source=dhcp

  25. echo This is the ending..

复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注-册

本版积分规则

Archiver|手机版|小黑屋|DoDVip ( 桂ICP备14000730号 )

GMT+8, 2024-4-29 07:55 , Processed in 0.057043 second(s), 20 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表