Devices Hide Specific Drives in Windows 11


Drive_banner.png

This tutorial will show you how to hide specific drive(s) from showing in File Explorer for all users in Windows 10 and Windows 11.

You can hide one or more drives to prevent them from showing in File Explorer < This PC and navigation pane, and still be able to open and access the hidden drive.

Hidden drives do not lose their assigned drive letter.

You will still be able to manually open and access hidden drives using any of the usual methods like below:
  • Typing the drive letter (ex: "F:") into the address bar of File Explorer, and press Enter.
  • Right click on the drive in Disk Management (diskmgmt.msc), and click/tap on Open.
  • Windows Terminal, Command Prompt, or PowerShell

You must be signed in as an administrator to hide and unhide drives.



EXAMPLE: "F" drive not hidden and hidden in File Explorer > This PC and navigation pane

Show_drive.png
Hde_drive.png



Here's How:

1 Open Registry Editor (regedit.exe).

2 Navigate to the key below in the left pane of Registry Editor. (see screenshot below)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer

Hide_drive-1.png

3 Do step 4 (unhide all drives) or step 5 (hide specific drives) below for what you want.

4 Unhide All Hidden Drives in File Explorer > This PC and Navigation Pane

A) In the right pane of the Explorer key, right click or press and hold on the NoDrives DWORD (if there), and click/tap on Delete. (see screenshot below step 2)​

B) Click/tap on Yes to confirm, and go to step 6 below. (see screenshot below)​

Hide_drive-3.png

5 Hide Specific Drive(s) in File Explorer > This PC and Navigation Pane

A) In the right pane of the Explorer key, double click/tap on the NoDrives DWORD to modify it. (see screenshot below step 2)​

If you do not have a NoDrives DWORD, then right click or press and hold on a blank space in the right pane of the Explorer key, click/tap on New, click/tap on DWORD (32-bit) Value, type NoDrives for the name, and press Enter.


B) Select (dot) Decimal, enter the Value data from the table below you want for a single drive or combination of drives to hide, click/tap on OK, and go to step 6 below. (see screenshot below)​

To hide a single drive, enter the value data (ex: "32") from the table below for the drive letter (ex: "F") of the drive you want to hide.

To hide a combination of drives, enter the added value data from the table below for the drive letters of each drive you want to hide. For example: To hide both the E (16) and F (32) drives, I would add 16 and 32 together from the table below, and enter 48.


Hide_drive-2.png

Driver Letter​
Decimal Value Data​
Show all drives0
A1
B2
C4
D8
E16
F32
G64
H128
I256
J512
K1024
L2048
M4096
N8192
O16384
P32768
Q65536
R131072
S262144
T524288
U1048576
V2097152
W4194304
X8388608
Y16777216
Z33554432
Hide all drives67108863

6 Close Registry Editor.

7 Either restart explorer process, sign out and sign in, or restart the computer to apply.


That's it,
Shawn Brink


 
Last edited:
Useful article but I have encountered one small snag, it appears that if you want to hide several drives that the drive letters have to be sequential (in my case V,W,X).
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Powercomputing
    CPU
    Intel(R) Core(TM) i9-10940X CPU @ 3.30GHz (3.31 GHz)
    Motherboard
    Asus
    Memory
    64Gb
    Graphics Card(s)
    Nvidia GeForce RTX3060
    Sound Card
    On board
    Monitor(s) Displays
    2 Benq GW2840
Useful article but I have encountered one small snag, it appears that if you want to hide several drives that the drive letters have to be sequential (in my case V,W,X).

Hello, and welcome to the forum. :alien:

You should be able to just add the values for any drive letters in the table to hide them.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gbps Download and 35 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
I assumed that was the case, however originally I had T, W and X to hide, adding the values didn't hide them all - and yes I did check my maths. The end result works fine for me.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Powercomputing
    CPU
    Intel(R) Core(TM) i9-10940X CPU @ 3.30GHz (3.31 GHz)
    Motherboard
    Asus
    Memory
    64Gb
    Graphics Card(s)
    Nvidia GeForce RTX3060
    Sound Card
    On board
    Monitor(s) Displays
    2 Benq GW2840
I assumed that was the case, however originally I had T, W and X to hide, adding the values didn't hide them all - and yes I did check my maths. The end result works fine for me.

It'll be interesting to hear if others see the same thing.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gbps Download and 35 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender

My Computers

System One System Two

  • OS
    Windows 11 Pro/All Channels
    Computer type
    Laptop
    Manufacturer/Model
    Acer Nitro ANV15-51
    CPU
    AMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 2
    Motherboard
    Sportage_RBH
    Memory
    32 GB DDR5
    Graphics Card(s)
    Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB GDDR6
    Sound Card
    AMD/Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (15.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9 144Hz
    Hard Drives
    Kingston OM8SEP4512Q 500 GB
    WDS500G2B0A-00SM50 500.1 GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Mouse
    MS Bluetooth
    Internet Speed
    Fiber 1GB Cox -us & IGB Orange-fr
    Browser
    Edge Canary- Firefox Nightly-Chrome Dev-Chrome Dev
    Antivirus
    Windows Defender
    Other Info
    VMs of Windows 11 stable/Beta/Dev/Canary
    VM of XeroLinux- Arch based & Debian 13 (Trixie)
  • Operating System
    Windows 11 Insider Canary
    Computer type
    Laptop
    Manufacturer/Model
    ASUS X751BP
    CPU
    AMD Dual Core A6-9220
    Motherboard
    ASUS
    Memory
    8 GB
    Graphics card(s)
    AMD Radeon R5 M420
    Sound Card
    Realtek
    Monitor(s) Displays
    17.3
    Screen Resolution
    1600X900 16:9
    Hard Drives
    1TB 5400RPM
If you hate doing math, here's a batch script.

Code:
<# : batch script
@echo off
powershell -nop Invoke-Expression ('$args = @(''%*'' -split '' '')' + [System.IO.File]::ReadAllText('%~f0'))
goto :eof
#>

foreach ($arg in $args) {
    if ($arg -notmatch '^[A-Z](:)?$') {
        continue
    }

    $Letter = $arg -replace ':'
    $Mask += [Math]::Pow(2,[int][char]$Letter.ToUpper() - 65)
}

$Mask

Code:
C:\Users\GARLIN\Downloads>script.bat E F
48

C:\Users\GARLIN\Downloads>script.bat E F:
48

C:\Users\GARLIN\Downloads>script.bat P R
163840
 

My Computer

System One

  • OS
    Windows 7
Before the other PS gurus jump in, I know you can do this as bitwise math.
Code:
    $Mask = $Mask -bor (1 -shl ([int][char]$Letter.ToUpper() - 65))
 

My Computer

System One

  • OS
    Windows 7
Before the other PS gurus jump in, I know you can do this as bitwise math.
Code:
    $Mask = $Mask -bor (1 -shl ([int][char]$Letter.ToUpper() - 65))
i'm not a guru, but heres a gui to do it. can select multiple and apply changes to hide them. will restart explorer once you click apply. will save opened explorer windows and relaunch them after restarting explorer. Unhide button will set the value back to 0, so same effect as Show All... can mod the gui if desired. just a quick draft. here is the code. .ps1 is attached.

Code:
# Self-elevate if not running as Administrator
$principal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if (-not $principal.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)) {
    $scriptPath = $MyInvocation.MyCommand.Definition
    Start-Process powershell.exe -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$scriptPath`"" -Verb RunAs
    exit
}

Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing

# Drive value mapping
$driveValues = @{
    "Show All" = 0
    "Hide All" = 67108863
    "A" = 1; "B" = 2; "C" = 4; "D" = 8; "E" = 16; "F" = 32; "G" = 64; "H" = 128
    "I" = 256; "J" = 512; "K" = 1024; "L" = 2048; "M" = 4096; "N" = 8192
    "O" = 16384; "P" = 32768; "Q" = 65536; "R" = 131072; "S" = 262144
    "T" = 524288; "U" = 1048576; "V" = 2097152; "W" = 4194304; "X" = 8388608
    "Y" = 16777216; "Z" = 33554432
}

# Create the form
$form = New-Object System.Windows.Forms.Form
$form.Text = "Hide Drives"
$form.Size = New-Object System.Drawing.Size(400,250)
$form.StartPosition = "CenterScreen"

# Label
$label = New-Object System.Windows.Forms.Label
$label.Text = "Select Drives:"
$label.Location = New-Object System.Drawing.Point(30,20)
$label.Size = New-Object System.Drawing.Size(100,20)
$form.Controls.Add($label)

# CheckedListBox
$checkedListBox = New-Object System.Windows.Forms.CheckedListBox
$checkedListBox.Location = New-Object System.Drawing.Point(30,50)
$checkedListBox.Size = New-Object System.Drawing.Size(200,150)
$checkedListBox.CheckOnClick = $true

# Populate with drive letters and options
$driveItems = @("Show All", "Hide All") + [char[]](65..90)
foreach ($item in $driveItems) {
    $checkedListBox.Items.Add($item)
}
$form.Controls.Add($checkedListBox)

# Auto-check/uncheck logic
$checkedListBox.Add_ItemCheck({
    param($sender, $e)
    $item = $checkedListBox.Items[$e.Index]
    if ($item -eq "Show All" -and $e.NewValue -eq [System.Windows.Forms.CheckState]::Checked) {
        for ($i = 2; $i -lt $checkedListBox.Items.Count; $i++) {
            $checkedListBox.SetItemChecked($i, $true)
        }
    }
    elseif ($item -eq "Hide All" -and $e.NewValue -eq [System.Windows.Forms.CheckState]::Checked) {
        for ($i = 2; $i -lt $checkedListBox.Items.Count; $i++) {
            $checkedListBox.SetItemChecked($i, $false)
        }
    }
})

# Apply Changes Button
$applyButton = New-Object System.Windows.Forms.Button
$applyButton.Text = "Apply Changes"
$applyButton.Location = New-Object System.Drawing.Point(250,50)
$applyButton.Size = New-Object System.Drawing.Size(100,30)
$applyButton.Add_Click({
    $selected = $checkedListBox.CheckedItems
    $totalValue = 0
    foreach ($item in $checkedListBox.CheckedItems) {
        $text = $item.ToString()
        if ($driveValues.ContainsKey($text)) {
            $totalValue += [int]$driveValues[$text]
        }
    }

    # Registry update using .NET
    $regKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"
    $baseKey = [Microsoft.Win32.Registry]::LocalMachine

    # Open or create the subkey
    $subKey = $baseKey.OpenSubKey($regKeyPath, $true)
    if (-not $subKey) {
        $subKey = $baseKey.CreateSubKey($regKeyPath)
    }

    # Ensure the value is cast to Int32
    $dwordValue = [System.Int32]$totalValue

    # Write the value as a DWORD
    $subKey.SetValue("NoDrives", $dwordValue, [Microsoft.Win32.RegistryValueKind]::DWord)
    $subKey.Close()

    # Save open Explorer windows
    $openFolders = @()
    $shellApp = New-Object -ComObject Shell.Application
    foreach ($window in $shellApp.Windows()) {
        try {
            $path = $window.Document.Folder.Self.Path
            if ($path -and (Test-Path $path)) {
                $openFolders += $path
            }
        } catch {}
    }

    Stop-Process -Name explorer -Force
    Start-Process explorer.exe
    Start-Sleep -Seconds 2
    foreach ($folder in $openFolders) {
        Start-Process explorer.exe -ArgumentList "`"$folder`""
    }

    [System.Windows.Forms.MessageBox]::Show("Changes applied. Registry updated and Explorer restarted.")
})
$form.Controls.Add($applyButton)

# Unhide Drives Button
$unhideButton = New-Object System.Windows.Forms.Button
$unhideButton.Text = "Unhide Drives"
$unhideButton.Location = New-Object System.Drawing.Point(250,90)
$unhideButton.Size = New-Object System.Drawing.Size(100,30)
$unhideButton.Add_Click({
    $regKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"
    $baseKey = [Microsoft.Win32.Registry]::LocalMachine
    $subKey = $baseKey.OpenSubKey($regKeyPath, $true)
    if (-not $subKey) {
        $subKey = $baseKey.CreateSubKey($regKeyPath)
    }
    if ($subKey) {
        $subKey.SetValue("NoDrives", 0, [Microsoft.Win32.RegistryValueKind]::DWord)
        $subKey.Close()
    }

    Stop-Process -Name explorer -Force
    Start-Process explorer.exe
    [System.Windows.Forms.MessageBox]::Show("Drives unhidden. NoDrives set to 0 and Explorer restarted.")
})
$form.Controls.Add($unhideButton)

# Cancel Button
$cancelButton = New-Object System.Windows.Forms.Button
$cancelButton.Text = "Cancel"
$cancelButton.Location = New-Object System.Drawing.Point(250,130)
$cancelButton.Size = New-Object System.Drawing.Size(100,30)
$cancelButton.Add_Click({ $form.Close() })
$form.Controls.Add($cancelButton)

# Show the form
$form.ShowDialog()
 

Attachments

My Computer

System One

  • OS
    Windows 11 Pro
Binary math is fun!
Code:
$BitMask = 163840

#                    Bit 25        15       7      0
#                         |         |       |      |
# Decimal 163840 = Binary 00000000101000000000000000
#                         ZYXWVUTSRQPONMLKJIHGFEDCBA
#                                 * *

# Shifting number value 1 one bit-position to the left is raising it to the next power of 2.

'bit 15 = {0}' -f (1 -shl 15)
'bit 17 = {0}' -f (1 -shl 17)

# -band (binary AND) checks if that bit position is set.
#
for ($i = 0; $i -lt 26; $i++) {
    if ($BitMask -band (1 -shl $i)) {
       'bit {0} = letter {1}' -f $i,[char](65 + $i)
    }
}
 

My Computer

System One

  • OS
    Windows 7

Latest Support Threads

Back
Top Bottom