Discussion:
eject flash drive?
(too old to reply)
T
2020-09-20 00:18:04 UTC
Permalink
Hi All,

Is there a way from the command line to eject a flash drive?

And can it be remounted later?

Many thanks,
-T
Kerr-Mudd,John
2020-09-20 08:19:16 UTC
Permalink
Post by T
Hi All,
Is there a way from the command line to eject a flash drive?
And can it be remounted later?
Many thanks,
-T
Yes. Or maybe no. DOS doesn't have much in the way of USB support.

under XP I use

RemoveDrive V3.1.0 (Win32) - prepares drives for safe removal
Freeware by Uwe Sieber - www.uwe-sieber.de
--
Bah, and indeed, Humbug.
T
2020-09-21 08:12:26 UTC
Permalink
Post by Kerr-Mudd,John
Post by T
Hi All,
Is there a way from the command line to eject a flash drive?
And can it be remounted later?
Many thanks,
-T
Yes. Or maybe no. DOS doesn't have much in the way of USB support.
under XP I use
RemoveDrive V3.1.0 (Win32) - prepares drives for safe removal
Freeware by Uwe Sieber - www.uwe-sieber.de
Thank you!
Arlen Holder
2020-09-30 17:50:05 UTC
Permalink
Post by T
Post by Kerr-Mudd,John
Post by T
Is there a way from the command line to eject a flash drive?
RemoveDrive V3.1.0 (Win32) - prepares drives for safe removal
Freeware by Uwe Sieber - www.uwe-sieber.de
Thank you!
It would be fantastic to have a Win+R command to unmount USB drives!

And just having once corrupted data, and dealing with recovery of a zillion
files, all flat, no longer in a hierarchy, and all missing their first
letter, etc., you'll NEVER want to go through that ordeal again.

IMHO, it's a PITA the way Windows' GUI umounts USB-mounted drives.
o I'd prefer a command similar to how Veracrypt umounts USB drives.

For example, I have a shortcut on Windows, called "unmount.lnk"
o TARGET === VeraCrypt.exe /dismount /force /q /silent

Where I put the path to that Windows shortcut in the AppPaths key:
o HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
o unmount.exe === c:\path\unmount.lnk

Then, to unmount the Veracrypt drives, I simply use the Win+R command:
o Win+R > unmount

Same for mounting, where Veracrypt happens to have a favorite option:
o Win+R > mountall
o mountall === VeraCrypt.exe /a favorites /q

It would be fantastic to have the same kind of commands for USB drives!
o Win+R > unmountusb
o Win+R > mountusb
--
Windows batch commands add Win+R fingertip power of huge efficiencies!
T
2020-09-30 20:09:24 UTC
Permalink
Post by Arlen Holder
Post by T
Post by Kerr-Mudd,John
Post by T
Is there a way from the command line to eject a flash drive?
RemoveDrive V3.1.0 (Win32) - prepares drives for safe removal
Freeware by Uwe Sieber - www.uwe-sieber.de
Thank you!
It would be fantastic to have a Win+R command to unmount USB drives!
And just having once corrupted data, and dealing with recovery of a zillion
files, all flat, no longer in a hierarchy, and all missing their first
letter, etc., you'll NEVER want to go through that ordeal again.
IMHO, it's a PITA the way Windows' GUI umounts USB-mounted drives.
o I'd prefer a command similar to how Veracrypt umounts USB drives.
For example, I have a shortcut on Windows, called "unmount.lnk"
o TARGET === VeraCrypt.exe /dismount /force /q /silent
o HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
o unmount.exe === c:\path\unmount.lnk
o Win+R > unmount
o Win+R > mountall
o mountall === VeraCrypt.exe /a favorites /q
It would be fantastic to have the same kind of commands for USB drives!
o Win+R > unmountusb
o Win+R > mountusb
1+

Speaking of pain in the asses, to remount a flash drive, you
have to reset the usb hub.
Arlen Holder
2020-10-01 00:13:02 UTC
Permalink
Post by T
Speaking of pain in the asses, to remount a flash drive, you
have to reset the usb hub.
I have to admit, I do not even understand what a "usb hub" is.
o I can barely figure out what USB drive does what on my PC!

For example:
o What solution do you use to figure out what USB drive letter in a Windows scripted command?
<https://groups.google.com/forum/#!topic/alt.comp.microsoft.windows/HkfHsx6chBk>

Based on that thread, here's a result from Sieber "USB Device Tree Viewer:
o Versus the Microsoft usbview.exe tool from the Windows SDK:
<Loading Image...>

Notice all those "hubs" on my desktop?
o What is the difference between them all? (Hell if I know.)

And better yet, notice what a right click on any of the devices allows?
o Safely remove
o Restart device

As shown in this screenshot of my system just now taken for you:
o <Loading Image...>

If there is a command-line option for those two actions in USBTreeView...
o Maybe that solves the original problem set?
--
Sometimes you need just a little bit of syntactical help to get it working.
Kerr-Mudd,John
2020-10-01 08:19:10 UTC
Permalink
On Wed, 30 Sep 2020 20:09:24 GMT, T <***@invalid.invalid> wrote:

[]
Post by T
Speaking of pain in the asses, to remount a flash drive, you
have to reset the usb hub.
You could actually pull it out & plug it in again!
--
Bah, and indeed, Humbug.
T
2020-10-01 17:38:48 UTC
Permalink
Post by Kerr-Mudd,John
[]
Post by T
Speaking of pain in the asses, to remount a flash drive, you
have to reset the usb hub.
You could actually pull it out & plug it in again!
That is what you are usually stuck with. It has its
pluses and misuses.

It is harder for ransomware to find after eject.
Cleavers ones will reset the hub.

Backup routines running unattended have to find
the flash drive. But you can always reset the hub.

Loading...