USB drives conceal many harmful viruses that can damage your computer. You may wish to prevent others from inserting USB drives into your computer to avoid infecting it. You can lock the USB ports on your computer to prevent USB insertion with these simple steps:
Step 1: Open the Run dialog box in Windows.
- Navigate to Start, type Run in the search bar, and press Enter.
- Alternatively, you can press the Windows + R combination.

Step 2: Type Regedit into the Run dialog box, then press OK (or Enter).

Step 3: Navigate to the keyword USBSTOR. Follow the path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\USBSTOR.

Step 4: Right-click on Start, in the Value data, enter the number 4, then click OK.

Exit Registry Editor, and you can plug in your USB to see the results.
From now on, your computer will not recognize any USB. To unlock the USB port, change the Value data to 3. Wish you success!
