如何禁用和启用通过命令提示符USB端口? [英] How disable and enable usb port via command prompt?
本文介绍了如何禁用和启用通过命令提示符USB端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何禁用和启用通过命令提示符USB端口?或使用批处理脚本?或使用VB脚本在Windows 7?
How disable and enable usb port via command prompt? or using batch script ? or using vb script in windows 7?
推荐答案
您可以使用批处理它给你几个选项。您可以编辑注册表项以被使用禁用USB设备
You can use batch which gives you a couple of options. You can edit the registry key to disable usb devices from being used
reg add HKLM\SYSTEM\CurrentControlSet\Services\UsbStor /v "Start" /t REG_DWORD /d "4" /f
要启用的值更改为 3
。
或者你也可以拒绝访问文件 Usbstor.pnf
和 Usbstor.inf
Or you can deny access to the files Usbstor.pnf
and Usbstor.inf
cacls %windir%\Inf\Usbstor.pnf /d user
cacls %windir%\Inf\Usbstor.inf /d user
其中,用户
是要拒绝访问的用户帐户。
Where user
is the user account that you want to deny access for.
要允许使用
cacls %windir%\Inf\Usbstor.pnf /p user:R
cacls %windir%\Inf\Usbstor.inf /p user:R
这两个命令需要管理员权限。
Both commands will need admin rights.
希望这有助于
这篇关于如何禁用和启用通过命令提示符USB端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文