--- title: "Deny USB write access" slug: "deny-usb-write-access" updated: 2025-10-08T04:21:20Z published: 2025-10-08T04:21:20Z canonical: "help.scalefusion.com/deny-usb-write-access" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.scalefusion.com/llms.txt > Use this file to discover all available pages before exploring further. # Deny USB write access The following PowerShell script helps the IT Admins to block write access on the USB drive. 1. Create a file on your desktop, for example, **usb_deny_write_access.ps1,** and open it in a text editor like notepad++ 2. Copy the contents below to the file or click [here](https://cdn.document360.io/175c0eac-012f-4410-bdc5-ac60794f82d8/Images/Documentation/usb_deny_write_access.ps1) to download the file. ```powershell $USBStorageRegKey = 'HKLM:\Software\Policies\Microsoft\Windows\RemovableStorageDevices\{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}' $StorageRegKey = 'HKLM:\Software\Policies\Microsoft\Windows\RemovableStorageDevices' $USBRegKey = '{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}' $RegName = 'Deny_Write' $exists = Test-Path $USBStorageRegKey if (!$exists) {    New-Item -Path $StorageRegKey -Name $USBRegKey -Force | Out-Null } New-ItemProperty -Path $USBStorageRegKey -Name $RegName -Value 1 -PropertyType 'DWord' -Force | Out-Null Restart-Computer -Force ``` 3. Choose the **Execution level** as: **Device level**. ![](https://cdn.document360.io/175c0eac-012f-4410-bdc5-ac60794f82d8/Images/Documentation/image-LRNFRX9T.png) 4. Once the script is executed successfully the computer restart is required for changes to take effect. 5. You can see its status in the View Status report on the Scalefusion dashboard. 6. Follow [our guide](/docs/deploy-powershell-scripts-using-scalefusion) to upload & publish the PowerShell script using Scalefusion Dashboard. > [!CAUTION] > Note: > > To use the PowerShell scripts, the Scalefusion MDM Agent Application must be installed on the device(s). Please follow [our guide](/docs/scalefusion-mdm-agent-application) to publish and install the Scalefusion MDM Agent Application. > [!CAUTION] > Note: > > 1. The scripts and their contents are sourced from various albeit authenticated Microsoft sources and forums. > 2. Please validate the scripts on a test machine before deploying them on all your managed devices. > 3. Scalefusion has tested these scripts, however, Scalefusion will not be responsible for any loss of data or system malfunction that may arise due to the incorrect usage of these scripts.