In many cases you may want to stop someone to plug his/her pen drive to your computer or laptop. so in do so you can disable USB driver via device manager but after disable it you can't your USB device's (Printer, Keyboard, Mouse etc) in your laptop or computer.
Here I'm with another solution, with this trick you can restrict only USB storage device such as like Pen drive, Portable HDD but you can use your USB ports for your printer and mouse also.
(Please note : This trick will restrict USB storage in ruining mode, its means you can use your pen drive in BIOS or Safe mode)
Please follow this steps to restrict USB storage device access to your System without affecting functional devices such as mouse and keyboard.
Step 1: Go to Group Policy Editor
By searching gpedit.msc on start menu and press enter.
Step 2: Select Removable Storage Access
On popup window, go to Computer Configuration > Administrative Templates > System > Removable Storage Access
Step 3: Double click on following items and enable configuration.
1. Removable Disks: Deny execute access
2. Removable Disks: Deny read access
3. Removable Disks: Deny write access
Step 4: Test System Now plug a storage device and try to open, It cant proceed any action.
Hope you got the solution, If you have some doubts or some more ideas, place it on comment box.
How to restrict/disable USB storage device without affecting keyboard and mouse