On my work computer I have two USB hard drives that I use rarely. They have a power save mode that sends them into sleep after a couple of minutes of them being idle.

Whenever I open a context menu on a file, the drives are woken up (most likely caused by the "send to" handler). So I eject the drive, but I can't find a way to get it back, other than unplugging and replugging it in.

Is there a way to unmount the drives, and then remount them only when I actually need them? (On Windows 7 Ultimate.)

  • If it's any help, I summarized all option within my answer for this question
    – Albin
    Sep 25, 2018 at 22:45

4 Answers 4


Remove the drive letters using mountvol or diskmgmt.msc. Without a drive letter, they won't appear under Computer or Send To.

mountvol Q: /p

Using /p will actually dismount the device. On older Windows versions, you only have /d, which only unassigns the drive letter, but keeps the volume mounted.

Reassign when needed, using the volume ID printed by mountvol:

mountvol Q: \\?\Volume{1be3da43-6602-11e0-b9e6-f11e1c50f5b5}\

You can also mount the volume on an empty folder (Unix style) using the same tools:

mkdir C:\fs\backup-disk
mountvol C:\fs\backup-disk \\?\Volume{1be3da43-6602-11e0-b9e6-f11e1c50f5b5}\

All these operations require Administrator privileges.

(In fact, you might even be able to directly use the volume ID in your backup scripts, without having to mount it anywhere. For example, \\?\Volume{1be3da43-6602-11e0-b9e6-f11e1c50f5b5}\projects instead of Q:\projects.)

  • 6
    By the way, is that GUID tied to the device? Will it be the same if I plug the device into another Windows machine? Is it even static between reboots on the same machine? Jun 11, 2011 at 21:53
  • 2
    @OliverSalzburg: The volume GUID is tied to that specific volume, and persists after reboots. (It has to, in order for persistent drive letter assignments and filesystem mounts to work.) But unfortunately it's local to the machine. (As far as I know, Windows has no way to reference volumes by label or filesystem UUID yet.)
    – user1686
    Jun 12, 2011 at 8:39
  • 3
    Is this really the same as unmounting in UNIX? On a UNIX box, once the volume is umounted, it's safe to rip it out of the computer. (Maybe it'll make your SATA bus upset, if you don't have the appropriate hardware support for that, and you might need to reboot, but you won't lose any data.) If you can still access the disk as \\?\Volume{...}, doesn't that mean the filesystem is still available to the OS, and therefore might have unflushed data in write cache and so on?
    – Glyph
    Feb 8, 2013 at 6:22
  • 3
    @DavidBalažic: /D only removes the drive letter (or path) assignment. Dismounting means detaching all such assignments, as well as closing the filesystem itself. Remember that Windows mounts all filesystems by default on the \\?\Volume{…} paths, and therefore regular mountvol usage only adds/removes additional ones (like mount --bind /x /y on Linux).
    – user1686
    Nov 22, 2013 at 16:11
  • 3
    So if I want Windows to completely "let go" of the volume, I have to use /P ? To get the same effect as umount on *nix? Using /D removes one letter/path assignment while the volume actually stays mounted? Nov 22, 2013 at 20:10

Use DISKPART to set your disk offline
It will stay offline even after a restart or a new power on

Use DISKPART to set it back online

This can be done in scripts

command file to put disk 2 offline:


 echo list disk              > c:\windows\temp\namexxxx.none
 echo select disk 2         >> c:\windows\temp\namexxxx.none
 echo offline disk          >> c:\windows\temp\namexxxx.none
 echo exit                  >> c:\windows\temp\namexxxx.none
 diskpart /s c:\windows\temp\namexxxx.none
 erase c:\windows\temp\namexxxx.none

command file to put disk 2 online:


 echo select disk 2 ........
 echo online disk ......

Execute as administrator

  • "list disk" is not needed, it only displays drive list to the user
    – trogper
    Aug 2, 2018 at 15:49

The correct answer is using the /P parameter to mountvol (see the comments in the accepted answer to understand why /D is not enough) but that only applies to recent windows versions (NT kernel version 6 and up).

The devcon utility as described in this answer works across all NT versions


CMD doesn't have a function implemented to eject USB drives. It can, however call Win COM Objects which have the needed functions implemented eg. Shell.Application via powershell, VBS, JS, etc.

Alternatively (if you know how to interface with USB host), you may create an executable from Win CMD to send commands directly to USB or via (Windows) OS, then call/run it from CMD (similar to writing a COM object or Powershell commandlets).

In powershell from CMD:

powershell "$driveEject = New-Object -comObject Shell.Application; $driveEject.Namespace(17).ParseName(\"E:\").InvokeVerb(\"Eject\"); start-sleep -s 3"

Ejecting disk via powershell also requires it to be unplugged & plugged back in to be mounted again. Otherwise the disk can just be unmounted so it's inaccessible until it's mounted again by either mountvol or diskpart.

eg. with mountvol:

REM unmount
mountvol e: /D or /P
REM mount for access
mountvol e: \\?\Volume{device GUID in hex with hyphens}\

mountvol allows mounting devices to a folder eg. C:\fakedisk\ as well as a drive letter.

eg. With diskpart:

REM unmount
echo select volume 3
echo remove letter=e dismount
) | diskpart

REM mount again for access
echo select volume 3
echo assign letter=e
) | diskpart

Tested in Win 10 cmd

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.