mrfangzheng

Hope and fear are useless. Be confident, and always be prepared for the worst.
  首页  :: 新随笔  :: 联系 :: 管理

命令行修改本机IP和DNS

Posted on 2009-05-12 17:02  mrfangzheng  阅读(783)  评论(0编辑  收藏  举报

SetIP.bat

runas /user:administrator "netsh int ip set address """本地连接""" static 10.10.20.44    255.255.255.0    10.10.20.1    1 "


runas /user:administrator "netsh int ip set dns """本地连接""" static 10.10.10.2 primary"

 

SetDHCP.bat

runas /user:administrator "netsh int ip set address """本地连接""" dhcp"


runas /user:administrator "netsh int ip set dns """本地连接""" dhcp"

注意 : 3个双引号