中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » 請問如何用命令的方式移除裝置
作者:
标题: 請問如何用命令的方式移除裝置 取消高亮 | 上一主题 | 下一主题
dosfroum
初级用户





积分 154
发帖 54
注册 2005-9-25
状态 离线
『楼 主』:  請問如何用命令的方式移除裝置

請問如用命的的方式移除裝置
如 usb大量儲存裝置,無線網路卡..等 會出現在右下角 移除裝置圖示裡面的東西
因為經常要插拔裝置 但是不想要每次去點好幾的步驟 想用批次檔的方式 然後放一個捷徑 工具列上 點一下就可以移除了 因為工作需求一天要插拔幾百次所以才會想要用批次檔的方式 感謝

2005-10-20 21:21
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
JonePeng
金牌会员

D◎$ Fαп


积分 4562
发帖 1883
注册 2004-1-19
来自 广东广州
状态 离线
『第 2 楼』:  

可以编写vbs脚本来控制鼠标进行自动点击。



----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
  
2005-10-20 22:33
查看资料  发送邮件  发短消息 网志  OICQ (373343541)  编辑帖子  回复  引用回复
dosfroum
初级用户





积分 154
发帖 54
注册 2005-9-25
状态 离线
『第 3 楼』:  

sorry vbs是啥
我只知道.bat @@a

2005-10-21 02:11
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
dosfroum
初级用户





积分 154
发帖 54
注册 2005-9-25
状态 离线
『第 4 楼』:  

目前找到一知軟體
devcon 似乎可以做到 但是不用用

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272
Device Console Help:
devcon.exe [-r] [-m:\\<machine>] <command> [<arg>...]
-r if specified will reboot machine after command is complete, if needed.
<machine> is name of target machine.
<command> is command to perform (see below).
<arg>... is one or more arguments if required by command.
For help on a specific command, type: devcon.exe help <command>
classfilter          Allows modification of class filters.
classes              List all device setup classes.
disable              Disable devices that match the specific hardware or
                       instance ID.
driverfiles          List driver files installed for devices.
drivernodes          Lists all the driver nodes of devices.
enable               Enable devices that match the specific hardware or
                       instance ID.
find                 Find devices that match the specific hardware or
                       instance ID.
findall              Find devices including those that are not present.
help                 Display this information.
hwids                Lists hardware ID's of devices.
install              Manually install a device.
listclass            List all devices for a setup class.
reboot               Reboot local machine.
remove               Remove devices that match the specific hardware or
                       instance ID.
rescan               Scan for new hardware.
resources            Lists hardware resources of devices.
restart              Restart devices that match the specific hardware or
                       instance ID.
stack                Lists expected driver stack of devices.
status               List running status of devices.
update               Manually update a device.
UpdateNI            Manually update a device without user prompt
SetHwID              Adds, deletes, and changes the order of hardware IDs of root-enumerated devices.

Example DevCon commands
devcon -m:\\test find pci\*

Lists all known PCI devices on the computer test. (By using-m, you can specify a target computer. You must use Interprocess communication (IPC) to access the computer.)

devcon -r install %WINDIR%\Inf\Netloop.inf *MSLOOP

Installs a new instance of the Microsoft loopback adaptor. This creates a new root-enumerated device node with which you can install a "virtual device," such as the loopback adaptor. This command also restarts the computer silently if a restart is required.

devcon classes

Lists all known setup classes. The output contains the short nonlocalized name (for example, "USB") and the descriptive name (for example, "Universal Serial Bus controllers").

devcon classfilter upper !filter1 !filter2

Deletes the two specified filters.

devcon classfilter lower !badfilter +goodfilter

Replaces the "badfilter" with the "goodfilter".

devcon driverfiles =ports

Lists files that are associated with each device in the ports setup class.

devcon disable *MSLOOP

Disables all devices that have a hardware ID that ends in "MSLOOP" (including "*MSLOOP").

devcon drivernodes @ROOT\PCI_HAL\PNP0A03

Lists all compatible drivers for the device ROOT\PCI_HAL\PNP0A03. This can be used to determine why an integral device information (.inf) file was chosen, instead of a third-party .inf file.

devcon enable '*MSLOOP

Enables all devices that have a hardware ID of "*MSLOOP". The single quotation mark indicates that the hardware ID must be taken literally (in other words, the asterisk ["*"] actually is an asterisk; it is not a wildcard character).

devcon find *

Lists device instances of all devices that are present on the local computer.

devcon find pci\*

Lists all known peripheral component interconnect (PCI) devices that are on the local computer (this command assumes that a device is PCI if it has a hardware ID that is prefixed by "PCI\").

devcon find =ports *pnp*

Lists devices that are present that are a member of the ports setup class and that contain "PNP" in their hardware ID.

devcon find =ports @root\*

Lists devices that are present that are a member of the ports setup class and that are in the "root" branch of the enum tree (the instance ID is prefixed by "root\"). Note that you should not make any programmatic assumption about how an instance ID is formatted. To determine root devices, you can look at device status bits. This feature is included in DevCon to aid in debugging.

devcon findall =ports

Lists "nonpresent" devices and devices that are present for the ports class. This includes devices that have been removed, devices that have been moved from one slot to another, and, in some cases, devices that have been enumerated differently due to a BIOS change.

devcon listclass usb 1394

Lists all devices that are present for each class named (in this case, USB and 1394).

devcon remove @usb\*

Removes all USB devices. Devices that are removed are listed with their removal status.

devcon rescan

Rescans for new Plug and Play devices.

devcon resources =ports

Lists the resources that are used by all devices in the ports setup class.

devcon restart =net @'ROOT\*MSLOOP\0000

Restarts the loopback adaptor ROOT\*MSLOOP\0000. The single quotation mark in the command indicates that the instance ID must be taken literally.

devcon hwids=mouse

Lists all hardware IDs of mouse class devices on the system.

devcon sethwid @ROOT\LEGACY_BEEP\0000 := beep

Assign the hardware ID, beep, to the legacy beep device.

devcon stack =ports

Lists the expected driver stack for the device. This includes device and class upper/lower filters, and the controlling service.

devcon status @pci\*

Lists the status of each device present that has an instance ID that begins with "pci\".

devcon status @ACPI\PNP0501\1

Lists the status of a specific device instance, in this case an Advanced Configuration and Power Interface (ACPI)-enumerated serial port.

devcon status @root\rdp_mou\0000

Lists the status of the Microsoft Terminal Server or Terminal Services mouse driver.

devcon status *PNP05*

Lists the status of all COM ports.

devcon update mydev.inf *pnp0501

Updates all devices that exactly match the hardware ID *pnp0501 to use the best driver in Mydev.inf that is associated with the hardware ID *pnp0501.

Note This update forces all devices to use the driver in Mydev.inf, even if there is a better match already on the system. This is useful when you want to install new versions of drivers during development before you obtain a signature. The update affects only the devices that match the specified hardware ID, and does not affect the child devices. If the specified .inf file is unsigned, Windows may display a dialog box that prompts you to confirm whether the driver should be installed. If a restart is required, this is reported and DevCon returns a level 1 error. If you specify -r, this causes a restart to occur automatically if one is required.

Notes
DevCon will return an error level for use in scripts:
"0" indicates a success.
"1" indicates that a restart is required.
"2" indicates a failure.
"3" indicates a syntax error.  
• If you specify -r and a restart is required, the restart occurs without warning after all devices have been processed.
• If you specify -m:\\computer and the command will not work for a remote computer, an error is reported.  
DevCon allows wildcards in instance IDs for interactive convenience. Do not assume anything about the format of an instance ID from computer to computer and from operating system version to operating system version.


2005-10-23 08:00
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: