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.)
Related videos on Youtube
Author by
Nathan Runge
Updated on September 18, 2022Comments
-
Nathan Runge over 1 year
How do I unmount a volume (USB flash drive) via command-line or Visual Basic script?
-
user1686 about 13 yearsAFAIK, neither DOS nor COMMAND.COM support USB flash drives. Did you mean
cmd.exe
? -
MaQleod about 13 yearsCheck this out: stackoverflow.com/questions/296560/… and also check this out: portableapps.com/node/639
-
-
user1686 about 13 yearsDespite 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.