READ ALSO -> Solutions to errors on USB ports and flash drives that are not recognized or impossible to use
1) USB Disk Manager
To quickly deactivate and reactivate the USB ports on the PC we can rely on the application USB Disk Managerfree and usable on any version of Windows.
After downloading the program, open it and go to the menu Disable USBwe press on Disable USB Removeable Disks and press down on OK for the changes to take effect; from now on any flash drive connected to the computer will no longer be viewable, it will not be possible to read its contents or write new files to it.
To reactivate the disabled ports, open the program again, open the menu again Disable USBclick on Enable USB Removeable Disks, and select the button OK to make all USB ports on your computer fully functional again.
2) URC ACCESS MODES
Among the best programs to quickly disable USB ports on company PCs or public workstations, we find URC ACCESS MODES a good free software with numerous control functions.
With this program we will be able to block the USB ports by simply pressing on LOCK; alternatively, we can also press on Disabled in the section USB Storage Devicescompletely blocking the detection of USB ports.
To re-enable USB ports blocked with this program, all we have to do is open the app again, and press UNLOCK about Full Access (in the section USB Storage Devices) to restore the proper functioning of all removable USB devices.
3) Windows Registry Editor
To disable access to USB sticks and external drives connected to the computer we can change a Windows 10 and Windows 11 configuration option, avoiding the use of external programs and effectively blocking the USB ports for standard users (who do not have administrative permissions to access the editor).
To proceed, press WIN+R on the keyboard, type regedit to open the registry key editor, and go to the following path:
Right-click on the last folder in the path (i.e Windows), select the item New -> Key, and choose as folder name RemovableStorageDevices.
Now select the new folder, press the right key on the empty space on the right, and press up New -> DWORD Value (32 bit)we choose as a name Deny_All and we set how value 1; now all that remains is to restart your PC for the changes to take effect.
To reactivate the USB ports blocked with this method, all we have to do is press on again Deny_All and set 0 (zero) as the value or, alternatively, delete the whole folder RemovableStorageDevices (right-click -> delete); in any case, we restart the PC to be able to apply the new registry changes.
4) Windows Group Policy Editor
In addition to the registry editor, you can disable and re-enable USB ports on your PC using the group policy editor present on all Pro and Enterprise editions of Windows 11 and Windows 10.
If we have these versions of Windows we open the menu Start let’s try gpedit to open the group policy editing tool, go to the path:
Configurazione computer > Modelli amministrativi > Sistema > Accesso agli archivi rimovibili
we identify the option All classes of removable storage: Deny all access and set it to Activated.
To reactivate the doors, bring us back to the indicated option and set Deactivated or Not configured to revert the changes.
To learn more we can read our guides on how to install Group Policy Editor (gpedit.msc) in Windows Home come on how to use Windows Local Group Policy Editor (gpedit.msc).
Whatever the method used we will be able to disable and re-enable your PC’s USB ports with a click or with simple changes to the Windows registry thus making the PC totally immune to viruses that travel via USB sticks (among the most fearsome, especially in public offices or on PCs exposed to use by several people).
On the same subject we can read our guides on how to disable Autoplay and protect your PC from USB stick viruses come on how to use a usb stick to lock and unlock your computer.