Hide a Drive Letter with Remove-PartitionAccessPath
Remove a partition's drive letter so it disappears from File Explorer while all data stays intact — PowerShell instead of diskpart.
01Command
$ Get-Partition -DriveLetter D | Remove-PartitionAccessPath -AccessPath "D:\"02What it does
A drive letter is just an access path — removing it hides the volume from File Explorer and most apps without touching a single byte of data. This is the clean way to tuck away a clutter partition, a backup drive, or a dual-boot's other system volume. The PowerShell cmdlets do the same job as diskpart's remove letter, but with clearer syntax and safe pipeline handling. Record the disk and partition numbers first (Get-Partition), because you'll need them to assign a letter again later.
03Risk
04Undo
$ Get-Partition -DiskNumber 1 -PartitionNumber 2 | Add-PartitionAccessPath -AssignDriveLetter05Sources
- mountvolEvidence: mountvol can list volume GUIDs and remove/add mount points — the command-line alternative for hiding and restoring drive letters.
- Remove-PartitionAccessPathEvidence: Remove-PartitionAccessPath removes a drive letter or mount point from a partition, making it inaccessible in Explorer while the data stays intact.
Last verified: 2026-09-18 · Category: Files & Folders
06Related solutions
One PowerShell line showing drive letters, labels, filesystems and free space for every volume.
Read-only PowerShell view of each disk's model, bus type, health and partition style.
Search inside text files and logs with regex, returning file, line number and match.