- There are multiple methods to block or restrict access to USB ports in Windows depending on your needs and desired security level.
- You can use built-in tools such as Device Manager, Registry Editor, and Group Policy, as well as external programs.
- It is possible to apply total, write-only, or device-specific locks, tailoring the protection to each specific case.
Since their inception, USB ports have been one of the major gateways for information entry and exit on any computer. Their advantages are enormous, but they also pose certain security risks. Therefore, learning how to block access to USB ports It is basic, especially when it comes to shared equipment.
Beyond business environments, more and more private users are opting to block access to the USB ports on their computers. various reasonsFrequent travel, working in public spaces, fear of USB flash drive attacks, or simply to ensure that no one connects anything to your PC without authorization. In this article, we explain how to do it.
Why is blocking USB ports important?
The indiscriminate use of USB ports opens several vulnerabilities on a computer. Not only can confidential information be copied and retrieved in a matter of seconds, but it's also possible to introduce viruses or malware immediately by simply plugging in an infected external memory. Therefore, Controlling who can or cannot use USBs is key to maintaining the integrity and privacy of your data..
Block access to USB ports significantly reduces these risks. Obviously, it's also essential to assess which devices you need to continue using (mouse, keyboard, printer, etc.), as well as knowing how to reverse the process if you ever need to re-enable the ports.

Top Methods to Block USB Ports in Windows
There are Several ways to block access to USB ports on a Windows computer: from quick and easy solutions to more advanced ones that require touching the system registry, modifying group policies, or even intervening from the BIOS/UEFIAdditionally, there are third-party tools designed for less experienced users or those looking for an even more automated method.
1. Quick lock from Device Manager
This is probably the most direct and hassle-free way to disable the use of USB devices:
- Right-click the Start button and select “Device Manager.”
- In the window that opens, look for the “Universal Serial Bus (USB) controllers” section.
- Right-click on each USB device or controller you see and select “Disable Device.”
It's important to note that doing so may render USB drives and other connected peripherals (except those using Bluetooth) unusable. If you ever want to revert this change, simply return to the Manager and "Enable" the controllers.
2. Modifying the Windows Registry
For those who have certain technical knowledge and are looking for a robust solutionThe Windows registry allows you to block access to USB ports completely. There are two main ways:
- Press Win + R, writes regedit and click OK. The Registry Editor will open.
- Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor
- On the right side, double-click on the variable Start and change it 3 (enabled by default) to 4 (disabled). Accept and restart the computer.
With this, USBs will be completely disabledIf you need to enable them again in the future, repeat the process and return the value to 3.
You can also restrict access to writing on USB drives:
- Within the Registry Editor, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies
- If you don't see the key StorageDevicePolicies, create it manually.
- Create a DWORD value called WriteProtect and give it value 1 to block writing. The value 0 I would allow it again.
This way, you can read from USB drives but not copy files to them, which is very useful in shared or educational environments.
3. Use the Local Group Policy Editor (gpedit.msc)
If you use Windows Pro or Enterprise, you have access to the Group Policy Editor, a very powerful tool for manage permissions and blocks at the system or user level. To block access to all types of external storage:
- Open Run (Win + R), type gpedit.msc and press Enter.
- Browse by: Computer configuration > Administrative templates > System > Removable storage access.
- On the right side, double-click on "All removable storage classes: Deny access to all" and select the “Enabled” option.
- Click Apply and OK. Restart your computer.
This will prevent the use of USB drives, external drives, SD cards, and even CDs and DVDsIf you only want to block writing or reading, you'll find individual options for this in the same path.
In the future, you can undo the change by repeating the steps and selecting "Not Configured." This is a highly recommended method due to its robustness and ease of reversal.
The role of BIOS/UEFI in blocking USB ports
Some modern motherboards and laptops allow you to block access to USB ports directly from the BIOS/UEFI (software that boots before Windows). This method is more advanced and permanent, ideal for high-risk computers or to prevent even "live" systems from a USB flash drive from bypassing OS-level locks.
- You must access the BIOS/UEFI as soon as you turn on the computer (usually by pressing F2, Del, ESC or similar).
- Consult your motherboard or computer manual to locate the “USB Configuration” or “Integrated Peripherals” option.
- Look for the option to disable all USB ports and activate it.
Warning: Not all models include this feature, and tampering with the BIOS can render your computer unusable if not done carefully. It's recommended only if you have prior experience.

Solutions with third-party programs
If you prefer do not touch advanced settings or the registry, there are free and simple applications that allow you to quickly block or unblock USB ports:
- Nomesoft USB Guard: Lightweight and free for Windows, it blocks USB devices in just a few clicks. It prevents infections and can be easily reversed.
- USB Drive Disabler: Small and portable, it requires no installation or registry modifications. It allows you to activate or deactivate USB ports with a single button; ideal for users with limited experience and no additional configuration options.
These tools are typically intuitive and designed for those looking to protect their PC without risking any system changes.
How to allow specific USBs and block the rest
In some cases It is a good idea to block access to USB ports except for those devices you own or trust.This is possible using the Group Policy Editor in Pro and Enterprise environments by following these steps:
- Open the Group Policy Editor (gpedit.msc).
- Go to Computer Configuration > Administrative Templates > System > Device Installation > Device Installation Restrictions.
- Activate the option "Prevent installation of devices that match any of these device IDs" and add the IDs of the USBs you want to block (you can check the ID in the Device Manager).
- Additionally, you can only allow installation of devices that you specify by selecting "Allow installation of devices that match any of these device IDs."
This way, your computer will only accept specific devices and block any attempts to connect other unknown USB devices. It's a very powerful and versatile method, although somewhat more laborious to configure.
USB writing restrictions without blocking reading
Sometimes it's just interesting prevent files from being copied to USB drives, but you want to keep the option to read files from those drives open. This is ideal for classrooms, businesses, or collaborative environments:
- You can do it from the Windows Registry (as described before) by creating or editing the value WriteProtect to “1” in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies.
- From gpedit.msc: Under "Removable Storage Access," you'll find the "Removable disks: Deny write access" policy. Enabling this policy will allow only reading, but not copying or modifying files.
Reversing write protection is simple: change the value to 0 or disable the corresponding policy.
Frequently Asked Questions About Blocking USB Ports
- Can only specific ports be blocked? Yes, Device Manager allows you to disable specific ports, and the Group Policy Editor allows selective restrictions by device ID.
- What if I want to re-enable the USB ports? You just need to revert the changes: enable the controller in the Administrator, modify the value in the Registry, or remove the applied policy.
- Is it possible to block access to USB ports in other versions of Windows? Yes, although the steps and tools vary slightly. See version-specific guides.
- Does blocking USB ports affect all devices? For most methods, yes. It's important to consider whether you need other peripherals or if you can use alternatives like Bluetooth.
There are multiple options for blocking access to USB ports on any Windows PC, from simple, reversible solutions to more advanced methods using specialized software. Taking control of your USB ports will allow you to maintain security and peace of mind in your digital environment.
Editor specialized in technology and internet issues with more than ten years of experience in different digital media. I have worked as an editor and content creator for e-commerce, communication, online marketing and advertising companies. I have also written on economics, finance and other sectors websites. My work is also my passion. Now, through my articles in Tecnobits, I try to explore all the news and new opportunities that the world of technology offers us every day to improve our lives.