安全删除硬件后怎样恢复启用硬件

jinggangshi 2015-02-03 08:41:08
在Windows的系统托盘中,可以安全移除USB设备及光驱、移动硬盘,但这些设备如果要重新使用,需要重新拔插才能启动,能否用命令重新启动这此设备而不需要拔插,在编程中如何实现。
我知道命令行禁用或移除设备可用:
devcon disable @"USB\VID_0951&PID_1666\60A44C4138D8BEA1997801B5"

devcon remove @"USB\VID_0951&PID_1666\60A44C4138D8BEA1997801B5"

这样移除的可用命令恢复:
devcon enable @"USB\VID_0951&PID_1666\60A44C4138D8BEA1997801B5"

devcon rescan

但如果是从系统托盘中移除的,这两条命令没有用,系统是断电的。

除了拔插,能以任意编程方式解决:从系统托盘中移除的硬件后的恢复问题?
谢谢大家
...全文
227 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
jinggangshi 2015-04-07
  • 打赏
  • 举报
回复
这个,没有用
赵4老师 2015-02-03
  • 打赏
  • 举报
回复
不一定行,仅供参考: C:\>devcon /? Device Console Help: devcon [-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 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. sethwid Modify Hardware ID's of listed root-enumerated devices. stack Lists expected driver stack of devices. status List running status of devices. update Manually update a device. updateni Manually update a device (non interactive).

64,637

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧