6

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

Jotham
  • 498

3 Answers3

5

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."
2

You can use DevEject.

paradroid
  • 23,297
1

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.)

grawity
  • 501,077