Dismount a USB Volume from Command-line

7,257

Solution 1

Check out the two following Windows utilities:

  • Mountvol - "Creates, deletes, or lists a volume mount point."
  • Devcon - "Using DevCon, you can enable, disable, restart, update, remove, and query individual devices or groups of devices."

Solution 2

You can use DevEject.

Solution 3

From a batch script, the easiest way is to call USB Disk Ejector. (Sync might work too, but it wants a drive letter, which is not always predictable.)

Share:
7,257

Related videos on Youtube

Nathan Runge
Author by

Nathan Runge

Updated on September 18, 2022

Comments

  • Nathan Runge
    Nathan Runge over 1 year

    How do I unmount a volume (USB flash drive) via command-line or Visual Basic script?

  • user1686
    user1686 about 13 years
    Despite the name, mountvol doesn't do the same thing as the other tools (which is to sync and unmount the filesystem); rather it only manages paths through which a mounted filesystem can be accessed.