How to block, disable, or force detection of USB ports in Windows step by step

Last update: 02/07/2025
Author Isaac
  • Block the ports USB is key to protecting security and data in Windows.
  • There are multiple methods depending on the level of restriction: from the Device administrator, registry, group policies or BIOS.
  • It is possible to limit access only to storage external or even block only writing.

Disable USB ports in Windows

Today, USB ports on Windows computers have become one of the main gateways for data entry and exit, and while their use is incredibly practical, they can also become a significant source of security problems and data loss. Therefore, more and more people—whether in home, business, or school environments—are looking to disable, block, or even force selective detection of certain USB ports to protect their computers and sensitive data.

Are you thinking about limiting access to USB devices on your PC? Or perhaps you need to prevent file copying or malware infection via a USB drive or external hard drive . Whatever your situation, here you'll discover all the possible ways to manage access to USB ports in Windows 10 and Windows 11. Let's get started with this comprehensive guide, full of details and practical tips for users of all skill levels.

Why block or disable USB ports in Windows?

You might be wondering if it's really worth the hassle of disabling USB ports on your computer. The answer is yes, and for several compelling reasons. Security is the primary motivation : USB drives can be used to introduce malware , steal confidential information (such as documents, photos, or passwords), or exploit vulnerabilities to hack your computer. Furthermore, tools like USB Rubber Ducky exist that can execute malicious scripts in just a few seconds.

In business environments , data leaks can be catastrophic, and uncontrolled USB devices are one of the most exploited vulnerabilities by disgruntled employees or external attackers. Similarly, in educational institutions, libraries, internet cafes, and other similar locations, blocking this access point is a simple way to prevent problems.

But the advantages don't end there: blocking USB ports also prevents others from copying data from your PC without permission , extracting sensitive information, or simply leaving your computer exposed to threats.

Methods to block, disable, or control USB ports in Windows

There are many ways to limit USB usage in Windows, depending on the level of restriction you're looking for. Below, we explain the most effective ones, organized from least to most difficult, always detailing pros, cons, and tips. This way, you can choose the one that best suits your situation.

Force detection of USB ports in Windows

1. From Windows Device Manager

This is the most direct and simple method for most users. It works on both Windows 10 and Windows 11 and allows you to block all USB ports at once or selectively.

  • Open Device Manager: press Windows + X and select “Device Manager” or search for “device manager” in the search bar.
  • Find Universal Serial Bus Controllers (USB): Expand the section and you will see all physical USB ports listed.
  • Disable USB portsRight-click on each specific driver or port and select "Disable Device." Confirm the action in the pop-up window.
  • Repeat the process for all visible USB ports if you want. block them completely.
  How to turn on the "Do Not Disturb" feature on iPhone

This method is useful if you know exactly which devices you want to disable. Keep in mind that if your keyboard or mouse uses USB, they will also stop working . Therefore, before disabling all of them, have a Bluetooth keyboard or mouse ready in case you need it.

If you later wish to re-enable the USB ports , follow the exact same process and choose "Enable device" instead of disabling.

2. Modifying the Windows Registry (regedit)

The Registry Editor allows you to globally disable the detection of USB storage devices without affecting other peripherals such as keyboards or printers. This method is more drastic but also more effective against users with limited technical knowledge who might want to circumvent the restriction.

  • Balance Windows + R, writes regedit and press Enter to open the Registry EditorIf you see an account control prompt, accept it.
  • Navigate to the following path:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR

  • In the right panel you will see a key called "Start". Double click on it and changes its value to 4 (usually comes in 3). Accept and close the editor.
  • Restart your computer for the changes to take effect.

From this point on, Windows will not detect any USB storage devices you connect. If you want to reactivate the USB ports , simply repeat the process but set the "Start" key to 3 instead of 4.

This method is ideal for blocking only external hard drives or USB flash drives , but it doesn't affect other USB devices like mice or printers. You can also apply the same method using PowerShell with specific commands if you prefer (useful for IT administrators).

How to Enable or Disable USB Ports in Windows 4
Related articles:
How to enable or disable USB ports in Windows

3. Using the Local Group Policy Editor (gpedit.msc)

This procedure is only available in Windows Pro or Enterprise versions. It allows you to block both reading and writing to any external storage device (flash drives, hard drives, etc.) and can be done at the user or computer level.

  • Press Windows + R, writes gpedit.msc and hit Enter.
  • Navigate the following route: Computer Configuration > Administrative Templates > System > Removable Storage Access.
  • On the right side look for "All removable storage classes: Deny access to all«. Double-click and select «Enabled».
  • Save the changes and restart your computer for the restriction to take effect.

This will prevent any user from using external storage devices. If you prefer to block writing but allow reading, look for the policy: "Removable disks: deny write access" and enable it.

Related articles:
How to fix Forza Horizon 3 crashing on Windows 10

4. Using the computer's BIOS or UEFI

Some computers allow you to disable USB ports from the BIOS or UEFI . This method is the safest and most effective (no user can bypass the restriction without re-entering the BIOS), but it requires advanced knowledge and adherence to the manufacturer's warnings.

  • Restart your PC and enter the BIOS/UEFI (usually by pressing F2, DEL or ESC during startup) Boot, although it depends on the manufacturer).
  • Navigate through the menus until you find an option related to USB ports (USB Configuration, Integrated Peripherals, etc.).
  • Disable USB ports or just USB storage, depending on what your motherboard allows.
  • Save the changes and reboot.

Before messing with the BIOS, consult your motherboard manual or the manufacturer's website. Heads up! If you disable all USB ports, you also won't be able to use a USB keyboard or mouse to access the BIOS again, so it's essential to have alternative methods if you decide to use this one.

How to Fix Windows Getting Ready Crash on Wn 10
Related articles:
How to Fix Windows Getting Ready Crash on Wn 10

5. Using third-party applications and software

For those who don't want to complicate things by messing with Windows' internal settings, there are several free and easy-to-install tools to block USB ports , both temporarily and permanently.

  • Nomesoft USB Guard: A lightweight application that allows you to lock all USB devices with just a few clicks. It's ideal for users looking to keep their device protected without the hassle.
  • USB Drive Disabler: Portable tool, no installation required, with a single window from which you can quickly activate or deactivate USB ports.

Using these programs is very intuitive and perfect if you have little experience with Windows internal settings. However, always check that they are reliable and only download from trusted websites.

6. Prevent the use of USB ports only for storage

You might only want your PC to support USB printers, keyboards, or mice, but not external storage devices like flash drives or portable hard drives . To do this, the best solution is to modify the permissions for your USB storage device drivers.

  • Open File Explorer and navigate to C: \ Windows \ Inf.
  • Search the files usbstor.inf y usbstor.pnf.
  • Right-click on each one, select Properties, and go to the Security tab.
  • Add the users or groups you want to DENY access to and check the Deny Full Control box for those files.
  • Accept and repeat the process for both files.

In this way, users who have been denied permission will not be able to install USB storage devices even if they physically connect them.

7. Unmount or eject a USB drive to prevent its use

If you prefer something quick, you can simply eject the USB drive from Explorer so that no one can access it:

  • Open “This PC” and locate the drive you want to unmount.
  • Right-click and select “Eject.”

This will make the device inaccessible—even if it remains physically connected—and unusable unless it is remounted.

How to Block Write-Only USB Drives

In some cases, it's enough to prevent files from being copied to the USB drive but allow reading . This is useful if you only use the USB drive to view information but don't want to risk someone copying your data to a flash drive.

To block writing from the Windows Registry:

  • Balance Win + R, writes regedit and go to the path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies.
  • If the StorageDevicePolicies key does not exist, create it.
  • Create a new DWORD value called WriteProtect and set its value to 1.

Now, any attempt to copy files or a USB flash drive will be blocked by the system. You can revert this change by setting the value to 0.

In Pro or Enterprise versions of Windows, you can also do this from Group Policy by enabling the "Removable disks: Deny write access" option under "Removable storage access."

Can only certain USB ports be blocked?

Yes, it's possible to selectively block some USB ports while leaving others active, for example, for printers or keyboards. This can be done through Device Manager, disabling only the specific ports you want. Additionally, some parental control programs and enterprise solutions allow you to manage ports individually using visual interfaces.

Keep in mind that on desktop computers there are often multiple USB controllers, and it can be difficult to identify which one corresponds to each physical port.

Fix Windows stopped this device-0 error
Related articles:
How to fix error 0xC1900208 – 0x4000C: incompatible application and Windows update crashes
  How to Change the Screen Refresh Rate in Windows: Complete Guide