What is a batch file to disable USB drive write/read permission on Windows?
To disable USB drive write/read permission on Windows using a batch file, you can use the following steps:
1. Open Notepad or any other text editor.
2. Copy and paste the following code into the text editor:
REG add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies" /v WriteProtect /t REG_DWORD /d 1 /f
4. Save the file with a ".bat" extension, for example, "disable_usb_permissions.bat".
5. Double-click on the batch file to run it.
This batch file adds a registry key that disables write and read permissions on USB drives. To enable the permissions again, you can create another batch file with the following code:
REG add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies" /v WriteProtect /t REG_DWORD /d 0 /f
Save the file with a different name and run it to enable USB drive write and read permissions again.
1. Open Notepad or any other text editor.
2. Copy and paste the following code into the text editor:
REG add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies" /v WriteProtect /t REG_DWORD /d 1 /f
4. Save the file with a ".bat" extension, for example, "disable_usb_permissions.bat".
5. Double-click on the batch file to run it.
This batch file adds a registry key that disables write and read permissions on USB drives. To enable the permissions again, you can create another batch file with the following code:
REG add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies" /v WriteProtect /t REG_DWORD /d 0 /f
Save the file with a different name and run it to enable USB drive write and read permissions again.


Post a Comment