Our computers and laptops are most vulnerable to viruses and malware through the USB ports. By default, all USB ports are enabled. You can however block your USB ports from unauthorized access by disabling then from the administrator account.
A simple tweak in the registry will get this done for you without involving any third party software. Since the registry can only be edited from the Administrator account, any guest or visitor using a different user account cannot change without your consent.
How To Disable USB Ports From The Registry:
Launch the Registry editor. Launch the ‘Run’ utility and type ‘regedit‘ in it to open the registry editor.
Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbstor.
In the right pane, double click on Start. The value data is set to 3 by default. Which means the USB ports are enabled.
Change the value to 4 and click OK to disable the USB ports. Close the registry and refresh windows. You’ll notice that USB peripherals will not respond when plugged in to USB ports.
To enable the USB ports, repeat the steps above and change the value data to 3. Then click OK.
This trick works from Windows XP all the way up to Windows 10.
Create Your Own USB Blocker Tool:
If you find yourself often blocking and unblocking USB ports on your computer, you can create your own tool to easily block and unblock USB ports.
Open notepad and paste this code in it.
Windows Registry Editor Version 5.00
Then Save As this as Disableusb.reg This will create a .reg file that can be used to edit the registry. This is how it should look like.
Now you need to create another one for Enabling. Change the highlighted value to 3 and then go to the Save As menu again. Save this as Enableusb.reg
Now you have two .reg files saved on your computer. To disable USB ports, simply double click on Disableusb.reg and confirm. To enable, double click on Enableusb.reg and confirm. Simple as that.
If you want to, you can download my ready made .reg files for enabling and disabling USB ports from the registry. A simple registry mode USB blocker.