|
zerostudy
中级用户
  
积分 266
发帖 98
注册 2006-4-21
状态 离线
|
『楼 主』:
用命令可以启用网卡或禁用网卡吗?
使用 LLM 解释/回答一下
2003 .dos下有什么命令可以?
In 2003, what commands are available under DOS?
|

纵是千年万年 亦难以忘记 |
|
2006-11-25 01:53 |
|
|
zerostudy
中级用户
  
积分 266
发帖 98
注册 2006-4-21
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
netsh interface set interface "本地连接" admin=ENABLED 是这样吗?格式怎么样写.
Last edited by zerostudy on 2006-11-25 at 02:05 AM ]
netsh interface set interface "Local Area Connection" admin=ENABLED Is that so? What's the format?
Last edited by zerostudy on 2006-11-25 at 02:05 AM ]
|

纵是千年万年 亦难以忘记 |
|
2006-11-25 01:56 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
兄的代码貌似不是禁用"网卡"
Brother's code doesn't seem to disable the "network card"
|

三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。 |
|
2006-11-25 02:19 |
|
|
ddyou
新手上路

积分 14
发帖 5
注册 2006-12-9
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
来了……
前言:因为需要在批处理下禁用网卡和启用本地连接,所以专门找了不少这样的贴子,在网上也有不少人写出 netsh interface set interface "本地连接" "disabled"这类的语句来说可以禁用,可是事实上---------用netsh不能成功禁用网卡,至少偶试了N个小时是不成功的,幸好找到了--------devcon.exe,这个微软开发的一个小东东,虽然不是很智能,但一定程序上解决了问题,下面说说关于它的概要:
DevCon 实用工具是一种命令行实用工具,可以替代设备管理器。使用 DevCon,您可以启用、禁用、重新启动、更新、删除和查询单个设备或一组设备。DevCon 还提供与驱动程序开发人员有关、但无法在设备管理器中看到的信息。
可以将 DevCon 用于 Microsoft Windows 2000、Windows XP 和 Windows Server 2003,但不能将其用于 Windows 95、Windows 98 或 Windows Millennium Edition。
一般情况下的用法:(介绍几个常用的命令和语法)
1、devcon find
devcon find * [这个命令可以列出列出本地计算机上存在的所有设备的设备实例]
devcon find pci\* [列出本地计算机上所有已知的“外围组件互连”(PCI) 设备(如果一个设备的硬件 ID 以“PCI\”为前缀,此命令就认为该设备是 PCI 设备]
2、devcon disable *msloop [禁用硬件 ID 以“MSLOOP”结尾(包括“*MSLOOP”)的所有设备]
3、devcon enable '*MSLOOP
[启用硬件 ID 为“*MSLOOP”的所有设备。单引号指示必须严格按字面解释硬件 ID(换句话说,星号 [“*”] 真的是 一个星号,而不是通配符]
4、devcon remove @usb\*
删除所有 USB 设备。被删除的设备列出时将显示其删除状态
因为下面要讲一个实例,所以先说说硬件ID是啥玩艺,说实在的就是让大家知道怎么找出它,请看:
find pci\* 下面就是找出的一部分:
PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\3&13C0B0C5&0&58: Realtek RTL8139 Family PCI Fast Ethernet NIC
PCI\VEN_1106&DEV_0571&SUBSYS_18271019&REV_06\3&13C0B0C5&0&89: VIA Bus Master IDE Controller
PCI\VEN_1106&DEV_3038&SUBSYS_18271019&REV_80\3&13C0B0C5&0&80: VIA Rev 5 or later USB Universal Host Controller
这几行“:”前面的就是硬件ID,后面是设备名称.
偶要禁用网卡了,请看仔细:
devcon disable *DEV_8139* [就这样就行了,前提是你电脑里有devcon.exe]
偶要启用它了,同样的搞一下: devcon enable *DEV_8139*
如果您指定 -r 并且需要重新启动,则在处理完所有设备后,将在无任何警告信息的情况下重新启动就行了,其它的就不多说了,大家喜欢用的话就去下载一个压缩包在自己机子上用用吧,有些人可能想它要是有更强大的功能,就请各位自力更生……相信自己!
压缩包里是2个文件夹,一个是32 位用的,一个是64位用的,
DevCon.exe 文件包含以下文件:
文件 说明
I386\DevCon.exe 32 位 DevCon 工具的二进制文件。此文件在 64 位 Windows 上不能充分发挥作用。
Ia64\DevCon.exe 64 位 DevCon 工具的二进制文件。
Here comes...
Preface: Because I need to disable and enable the network card under batch processing, so I specially found many such posts. There are also many people on the Internet who write statements like netsh interface set interface "Local Area Connection" "disabled" to say that it can be disabled, but in fact ------- using netsh cannot successfully disable the network card. At least I have tried for N hours and it is not successful. Fortunately, I found ------- devcon.exe, this small thing developed by Microsoft. Although it is not very intelligent, it solves the problem to a certain extent. Now let's talk about the outline of it:
The DevCon utility is a command-line utility that can replace Device Manager. With DevCon, you can enable, disable, restart, update, delete, and query a single device or a group of devices. DevCon also provides information related to driver developers that cannot be seen in Device Manager.
You can use DevCon for Microsoft Windows 2000, Windows XP, and Windows Server 2003, but not for Windows 95, Windows 98, or Windows Millennium Edition.
General usage: (Introduce several common commands and syntax)
1. devcon find
devcon find *
devcon find pci\*
2. devcon disable *msloop
3. devcon enable '*MSLOOP
is really an asterisk, not a wildcard]
4. devcon remove @usb\*
Delete all USB devices. The deleted devices will display their deletion status when listed
Because an example will be talked about below, so first talk about what the hardware ID is. To be honest, it is to let everyone know how to find it. Please see:
find pci\* The following is part of what is found:
PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\3&13C0B0C5&0&58: Realtek RTL8139 Family PCI Fast Ethernet NIC
PCI\VEN_1106&DEV_0571&SUBSYS_18271019&REV_06\3&13C0B0C5&0&89: VIA Bus Master IDE Controller
PCI\VEN_1106&DEV_3038&SUBSYS_18271019&REV_80\3&13C0B0C5&0&80: VIA Rev 5 or later USB Universal Host Controller
The part before ":" in these lines is the hardware ID, and the part after is the device name.
I'm going to disable the network card. Please see carefully:
devcon disable *DEV_8139*
I'm going to enable it, do the same: devcon enable *DEV_8139*
If you specify -r and need to restart, then after processing all devices, it will restart without any warning information. I won't say more about the others. If everyone likes to use it, just download a compressed package and use it on your own computer. Some people may think that if it has more powerful functions, please help yourself... Believe in yourself!
There are 2 folders in the compressed package, one for 32-bit use and one for 64-bit use,
The DevCon.exe file contains the following files:
File Description
I386\DevCon.exe Binary file of the 32-bit DevCon tool. This file does not function fully on 64-bit Windows.
Ia64\DevCon.exe Binary file of the 64-bit DevCon tool.
|
|
2007-3-26 03:16 |
|
|
snow2000
新手上路

积分 8
发帖 4
注册 2006-3-9 来自 四川
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
DevCon 配合脚本可以实现你需要的功能 仔细研究一下DevCon就能写出脚本 来
DevCon combined with scripts can achieve the functions you need. Study DevCon carefully and you can write scripts.
|
|
2007-3-26 09:25 |
|
|
kingstry
新手上路

积分 12
发帖 6
注册 2007-3-14
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
DevCon 配合脚本可以实现你需要的功能 仔细研究一下DevCon就能写出脚本 来
我也找了N久.除了devcon真没找到其它更好的命令模式禁用网卡.
DevCon combined with scripts can achieve the functions you need. Study DevCon carefully and you can write scripts.
I have also been searching for a long time. Besides devcon, I really haven't found other better command modes to disable the network card.
|
|
2007-3-29 09:30 |
|
|
zts59
中级用户
  
积分 387
发帖 104
注册 2004-11-19
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
DEVCON也有局限性,在不知道网卡硬件ID的情况下,如何判断网卡的硬件ID?
DEVCON also has limitations. How to determine the hardware ID of a network card without knowing the hardware ID of the network card?
|
|
2007-3-29 10:04 |
|
|
flying008
中级用户
  
积分 245
发帖 103
注册 2006-6-30
状态 离线
|
|
2007-4-27 01:58 |
|
|
qq43142691
中级用户
  
积分 326
发帖 152
注册 2007-5-4
状态 离线
|
|
2007-5-4 10:01 |
|