How to block the USB drives in Windows?
If you need to prevent anyone from connecting USB drives to your computer, you can disable the use of flash drives, memory cards and hard drives using the built-in system tools. Mice, keyboards and other non-storage peripherals will continue to work.
To do this, use the local group policy editor:
1. Press “Win + R" and in the field enter the command "
gpedit .msc" to launch the editor.
2. If you want to disable the use of USB drives for all users of the computer, go to "Computer Configuration". If required block access only for the current user, select User Configuration.
3 . In the selected section, open "Administrative Templates" → "System" → "Access to Removable Storage Devices".
four. Open the setting "Removable storage devices of all classes: Deny all access" and set the value to "Enabled" and tap "Apply".
This will complete the process and block USB access. Rebooting the computer is not required, however, if the drive was already connected at the time the restrictions were enabled, changes to it will take effect only after disconnecting and reconnecting.