Link to home
Start Free TrialLog in
Avatar of RayT
RayTFlag for United States of America

asked on

USB Drive Ejection using MS Visual Studio Pro

I'm creating application using Microsoft Visual Studio Professional 2022 (Visual Basic). And my OS is Microsoft Windows 11 Pro for Workstations


Within the app I want to be able to eject a USB drive.


Is there a simple way to accomplish USB drive ejection?

Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Avatar of Bill Prew
Bill Prew

I've never had to do this, so was curious.  In some quick looking it doesn't seem to be easy, it's more complex than I might have guessed.  Including a few of the more popular links I peeked at in case you are interested.

Would you want to eject the same drive letter all the time, or "locate" the desired USB by volume name, etc?



»bp
Avatar of RayT

ASKER

In my application i want to be able to pass the drive letter and the function will do the rest.

Avatar of RayT

ASKER

The ones Bill shows are the ones i've seen.  The amount of code to perform a seemingly simple task is crazy!  I was hoping to find one that's much shorter.

Agreed, I was a bit surprised at the amount of code...

»bp
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RayT

ASKER

Thanks!  Have a Happy Thanksgiving!