You can disable or enable USB ports by using different methods like device manager, registry editor and any other third-party applications software. Using the Registry Editor, you can easily disable or enable the USB Ports.
Step 1: Go to Start > Run, type “regedit” and press enter to open the registry editor.
Step 2: Registry Editor Window will be opened and go to the
following path:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR
Step 3: In the right pane, select Start and see the default value data of Start is ''3''. To disable the USB Ports, set its value data to ''4'' and then click OK.
Step 4: Restart your Computer or disconnect your USB device for the changes to take effect.
Note: By Registry Editor, just disable the use of USB storage devices, but it would not affect the use of USB mouse, keyboard and others device.