Hide these specified drives in My Computer: registry value NoDrivesUserHKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
- Policy ID
- NoDrives
- Scope
- User Configuration
- Supported on
- At least Windows 2000
- Source
- Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (version 1.0)
- Category
- Windows Components › File Explorer
Registry
NoDrives
REG_DWORDUser- Enabled value
- Depends on the option value
- Element
- Pick one of the following combinations
| Item | Stored value |
|---|---|
| Restrict A and B drives only | 3 |
| Restrict C drive only | 4 |
| Restrict D drive only | 8 |
| Restrict A, B and C drives only | 7 |
| Restrict A, B, C and D drives only | 15 |
| Restrict all drives | 67108863 |
| Do not restrict drives | 0 |
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] ; Options (use only one) ; Restrict A and B drives only "NoDrives"=dword:00000003 ; Restrict C drive only "NoDrives"=dword:00000004 ; Restrict D drive only "NoDrives"=dword:00000008 ; Restrict A, B and C drives only "NoDrives"=dword:00000007 ; Restrict A, B, C and D drives only "NoDrives"=dword:0000000f ; Restrict all drives "NoDrives"=dword:03ffffff ; Do not restrict drives "NoDrives"=dword:00000000
CMD
:: Options (use only one) :: Restrict A and B drives only reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDrives" /t REG_DWORD /d 3 /f :: Restrict C drive only reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDrives" /t REG_DWORD /d 4 /f :: Restrict D drive only reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDrives" /t REG_DWORD /d 8 /f :: Restrict A, B and C drives only reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDrives" /t REG_DWORD /d 7 /f :: Restrict A, B, C and D drives only reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDrives" /t REG_DWORD /d 15 /f :: Restrict all drives reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDrives" /t REG_DWORD /d 67108863 /f :: Do not restrict drives reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDrives" /t REG_DWORD /d 0 /f
PowerShell
# Common: create the key New-Item -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Force | Out-Null # Options (use only one) # Restrict A and B drives only New-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'NoDrives' -PropertyType DWord -Value 3 -Force | Out-Null # Restrict C drive only New-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'NoDrives' -PropertyType DWord -Value 4 -Force | Out-Null # Restrict D drive only New-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'NoDrives' -PropertyType DWord -Value 8 -Force | Out-Null # Restrict A, B and C drives only New-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'NoDrives' -PropertyType DWord -Value 7 -Force | Out-Null # Restrict A, B, C and D drives only New-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'NoDrives' -PropertyType DWord -Value 15 -Force | Out-Null # Restrict all drives New-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'NoDrives' -PropertyType DWord -Value 67108863 -Force | Out-Null # Do not restrict drives New-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'NoDrives' -PropertyType DWord -Value 0 -Force | Out-Null