Nowadays, USB devices such as a flash drive, external hard disk, USB keyboard etc are used almost on a daily basis. It's definitely the case with myself, namely performing backups to my external HDD. Whilst they serve their purpose well for legit reasons, anyone with malicious Intent who has physical access to your PC, can Inject a payload by simply plugging In the device. In this tutorial, I will demonstrate how to prevent access to all USB ports on your computer, thus any USB device that's plugged In, will not function.
To achieve this, I will be using the Group Policy Editor, which Is native to Windows 10 Pro, Enterprise and Education editions. If you do not have either of these Installed, upgrade your OS at your earliest convenience.
Essentially, after applying this setting, any USB device that's plugged Into your PC, will be rejected by the operating system. Pretty cool, yes? So let's see how this Is done with the following guide.
To access the Group Policy Editor, open the Run menu, enter "gpedit.msc" (no quotes) and hit OK.
Next, navigate to the following directory:
"Computer Configuration > Administrative Templates > System > Removable Storage Access".
Then on the right pane, double-click:
"Removable Disks: Deny read access".
On the left of the window, click the "Enabled" radio button and to finalize the process, simply hit "OK".
Now to put this to the test. Here's what happened when I plugged In my USB flash drive and attempted to open It. As you can see, access Is denied.
To reverse the change, go back to Step Three above, and select the "Not Configured" radio button. The good thing about this tweak, Is that It's very easy to apply and unlike the Windows Registry, a reboot Is not required for changes to take effect.
Be careful though- If you have a USB mouse whilst applying the tweak and for one reason or another, solely rely on that to perform your tasks, It'll disable It's functionality altogether. And If that's your only means to navigate on your PC by way of clicking files, folders, options and settings, well, you'll be locked out of performing such tasks!