How to block USB file sharing in my PC


I have a common PC which is shared as a file server for small group of people. I want to disable USB file sharing in that system to prevent any virus spreading to my network. But I am little confused does this block keyboard and mouse also? because also using usb.

1 Like

Hey there!
Check this video for the solution
And to answer the question, no it should not block that because it is a different direction of USB

hello @RafathR

you can disable pen drive using group policy. with the group policy you can disable any removable device such as pen drive and external harddisk, you can make write protect also.
you will have to run gpedit.msc command
here is the link that will support you

1 Like

Follow the below steps, thereafter, anyone who connects a USB drive to your computer will be denied copy privileges, and they’ll get a “This disk is write-protected” message. As a result, no one will be able to edit, delete, create, or rename files in the external storage.

  1. Use the Windows key + R keyboard shortcut to open the Run command.

  2. Type gpedit.msc and click OK to open the Local Group Policy Editor.

  3. Browse the following path:

    Computer Configuration > Administrative Templates > System > Removable Storage Access

  4. On the right side, double-click the Removable Disks: Deny write access policy.

  5. On the top-left, select the Enabled option to activate the policy.

  6. Click Apply .

  7. Click OK .

  8. Close the Group Policy editor.

  9. Restart your computer to complete the task.
    After reboot, everyone who connects a USB drive will be denied access to save, edit, or delete any content from the removable storage.

1 Like


as @sarfrazjbd and @VIkasmadan adviced you can do this way

USB storage devices can be disabled either at the group policy level, or through the registry in the device but the group policy approach seems to be the safer option. Open the Group Policy Editor, and navigate through the console tree to Computer Configuration | Administrative Templates | System | Removable Storage Access.

If a USB storage device is already installed on the computer, you can change the registry to make sure that the device does not work when the other user connects to the computer.

You may try locking your USB ports, check steps below-
How to lock your USB ports in Windows?

1). How to prevent anyone from copying files to the USB drive?

2). How to prevent anyone from reading files on the USB drives ?

3). How to prevent anyone from reading files on SD/Card reader ?

4). How to prevent anyone from connecting to iPhone or Android phone ?