Open Group Policy Editor
Press
Windows + R, typegpedit.msc, and hit Enter.
2. Navigate to the USB Access Policies
Go to:
Computer Configuration → Administrative Templates → System → Removable Storage AccessAll Removable Storage classes: Deny all access SET TO ENABLEForce Group Policy Update
Open Command Prompt as Administrator.
Type: gpupdate /force and press Enter.
3. Restart Your Computer
Some changes may require a reboot to take full effect.
++++++++++++++++++++++++++++++
USB ENABLE/DISABLE SCRIPT
++++++++++++++++++++++++++++++++
@echo off
title USB Access Control Panel
color 0A
:MENU
cls
echo ================================
echo USB Access Control Panel
echo ================================
echo [1] Block USB Storage Access
echo [2] Unblock USB Storage Access
echo [3] Exit
echo.
set /p choice=Choose an option (1-3):
if "%choice%"=="1" goto BLOCK
if "%choice%"=="2" goto UNBLOCK
if "%choice%"=="3" exit
goto MENU
:BLOCK
echo Blocking USB storage access...
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v "Start" /t REG_DWORD /d 4 /f
echo Done. USB storage is now blocked.
pause
goto MENU
:UNBLOCK
echo Unblocking USB storage access...
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v "Start" /t REG_DWORD /d 3 /f
echo Done. USB storage is now unblocked.
pause
goto MENU
No comments:
Post a Comment