在命令提示符下面如何关闭网卡,用了netsh命令老提示参数不正确等等,最近找到microsoft官网,哈哈,原来microsoft提供了一款优秀的小工具---devcon来完成这个任务,当然,这款软件也可以扩展使用方向。我在这里先抛砖引玉了。

The DevCon command-line utility functions as an alternative to Device Manager

 

 

先看简要提示:

The DevCon utility is a command-line utility that acts as an alternative to Device Manager. Using DevCon, you can enable, disable, restart, update, remove, and query individual devices or groups of devices. DevCon also provides information that is relevant to the driver developer and is not available in Device Manager.

You can use DevCon with Microsoft Windows 2000, Windows XP, and Windows Server 2003. You cannot use DevCon with Windows 95, Windows 98, or Windows Millennium Edition.

大意是:devcon是一款命令行实用的工具,可以代理设备管理器。使用devcon,你可以开启,关闭,重启,更新,移动,查询个别的或者一组设备。devcon也提供有关驱动开发者与一些不存在设备管理器的信息。devcon支持win2000,xp,2003系列。

先看用netsh命令查看与试关闭网卡的结果

我的系统是windows xp professional edition sp3.

查看:

试关闭网卡,老提示参数不正确:

安装devcon,只要解压就可以,默认解压要系统临时目录:

在命令提示符下面找到devcon解压的目录:

先用查找到网卡的驱动,这里最好用>xx.txt(还不能是其他磁盘,不然会提示错误)让其生成一个文本文件,不然就是一堆驱动之类的,看起来特麻烦:

 

找到网卡的驱动名称:

 

命令关闭网卡

关闭前:

关闭后:

看网卡的图标没有了。

开启网卡:

ok,实验结束,其实devcon是直接禁用/开启 网卡的驱动,当然也可以试试其他的驱动,比如说声卡,显卡,还有tcp/ip驱动啥的,即可以管理本地也可以管理远程。放上一条命令图,有喜欢折腾系统的可以试试,支持x86与x64位哦。