files-community/Files

Feature: The ability to Eject a drive

Closed this issue · 3 comments

What feature or improvement do you think would benefit Files?

The ability to eject a drive is crucial, where we have a couple of dev drives and other such media, we can not simply 'pull the plug', so to speak

Here is the stock file explorer with the option

Image

Here is the files without the option for a dev drive

Image

Requirements

Nothing extra will be required but simply wiring it to eject

The exact command depends on whether V: is a mounted VHDX or a removable USB/DVD drive.

🔹 If V: is a VHDX you mounted with Mount-DiskImage
You can dismount it with:
PowerShell:

Dismount-DiskImage -ImagePath "L:\Code.vhdx"

That will cleanly eject the virtual disk and free up the V: letter.
Batch (.bat):

powershell -Command "Dismount-DiskImage -ImagePath 'L:\Code.vhdx'"

🔹 If V: is a removable drive (USB, DVD, etc.)
You can use Remove-PartitionAccessPath or Get-Volume with Eject:
PowerShell:

$vol = Get-Volume -DriveLetter V
$vol | Get-Disk | Set-Disk -IsOffline $true

Or, for removable media specifically:

$drive = Get-Volume -DriveLetter V
$drive | Get-PhysicalDisk | Out-Null

For USB/DVD, you can also use:

(New-Object -comObject Shell.Application).NameSpace(17).ParseName("V:").InvokeVerb("Eject")

Batch (.bat):

powershell -Command "(New-Object -comObject Shell.Application).NameSpace(17).ParseName('V:').InvokeVerb('Eject')"

Files Version

4.0.11.0

Windows Version

10.0.26200.6899

Comments

This feature is super useful

Thanks for the feedback, we're tracking this in the below linked issue. You can check there or click subscribe in the right sidebar for updates.

Thanks, but please do implement this quickly, as it is an essential one.

There is no timeline on when issues are fixed. You can use the taskbar icon for USB and Windows File Explorer for virtual drives currently