使用netsh命令行设置IP-WINDOWS

首 先需要管理权限,然后需要支持netsh的 windows 系统( VISTA以上)。

通过以下命令获得自己要操作的那块 网 卡

netsh interface show interface

设置IP为DHCP模式

netsh interface ip set address WLAN source=dhcp
netsh interface ip set dnsservers WLAN source=dhcp

其中 WLAN是你的 网卡名

以下代码设置一个静态IP

netsh interface ip set address WLAN static 192.168.1.30 255.255.255.0 192.168.1.1
netsh interface ip set dnsservers WLAN static 192.168.1.1

同样 WLAN是网卡名,这 明显是一个无线网 卡。

记着它以后希望能在用时简单一点。

关于xmsg

技术面前人人平等.同时技术也不分高低贵贱.正所谓学无大小,达者为尊.
此条目发表在Windows分类目录,贴了, 标签。将固定链接加入收藏夹。