3

How to disable and enable USB port via command prompt? Or using a batch script or VBScript? The OS is Windows 7.

  • what do you mean by disable? As in turn it of physically? – Piotr Kula Nov 7 '12 at 10:04
  • no. problematically disable the usb port to prevent unauthorized access data from my pc – messi fan Nov 7 '12 at 10:08
9

Download utility devcon from Microsoft.

Then, use it as follows: List all known USB devices:

devcon find USB*

Disable USB device:

devcon disable "USB\VID_xxxx&PID_yyyy"

Enable USB device:

devcon enable "USB\VID_xxxx&PID_yyyy"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.