卡饭网 > windows > 正文

windows如何动态修改ip(脚本命令)

来源:本站整理 作者:梦在深巷 时间:2013-05-03 13:55:11

办公网络和家里的网络不一样 总是要换来换去,弄了一个脚本,双击运行就可以了,win7 要用超级管理员去运行

echo 设置ip 默认子网 默认网关 开始(无线网络连接:就是网络连接名称,也可以是‘本地连接’ )

netsh interface ip set address "无线网络连接" static 192.168.137.111 255.255.255.0 192.168.137.1

echo 设置ip 默认子网 默认网关 结束

echo 设置主dns ip 开始

netsh interface ip set dns "本地连接" static 192.168.4.4

echo 设置主dns ip 结束

echo 设置副dns ip 开始

netsh interface ip add dns "本地连接" 192.168.5.5

echo 设置副dns ip 结束

echo 先禁用网卡

netsh interface set interface "本地连接" disable

echo 使用reg add命令修改物理地址(D4BED9989936 mac地址)

reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class/{4D36E972-E325-11CE-BFC1-08002BE10318}/0011 /v NetworkAddress /d D4BED9989936 /f

echo 再启用网卡

netsh interface set interface "本地连接" enable

pause

相关推荐