[英]Disable a specific USB port in Windows
I need to disable a specific USB port programmatically on a Windows PC. 我需要以编程方式在Windows PC上禁用特定的USB端口。
For example, let's say I have 2 removable disks plugged into my computer - one called F:\\ and one called H:\\ . 例如,假设我在计算机中插入了2个可移动磁盘-一个名为F:\\,另一个名为H:\\。 I want to disable only F:\\ programmatically.
我想以编程方式仅禁用F:\\。 I've already tried to use this CMD command to disable the device:
我已经尝试使用此CMD命令禁用设备:
reg add HKLM\\SYSTEM\\CurrentControlSet\\Services\\UsbStor /v "Start" /t REG_DWORD /d "4" /f
and this one to enable the device: 而这一启用设备:
reg add HKLM\\SYSTEM\\CurrentControlSet\\Services\\UsbStor /v "Start" /t REG_DWORD /d "3" /f
But it does not work at all. 但这根本不起作用。
Any suggestions ? 有什么建议么 ? Thanks, Yahli.
谢谢,Yahli。
reg add HKLM\SYSTEM\CurrentControlSet\Services\UsbStor /v "Start" /t REG_DWORD /d "4" /f
将值更改为3
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.