Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I'm working on a project about USB disk Control and I need to eject USB disk via driveletter or serial number
I've read a lot of articles, posts ...
But i couldn't find anythig that i can use
Could u help me ??


Note: Ive read Eject USB disks using C#[^] but i need just eject function(Method)
Posted
Comments
Sergey Alexandrovich Kryukov 1-Jul-11 2:22am    
What do you mean "just eject"? Do you think this article does not explain eject, or you're just lazy to look through all of it? Just asking...
--SA
yigido580638 1-Jul-11 2:56am    
eject = safely remove
i cant speak Eng. very well
i wanna a Function that it takes drive letter or serial number of usb disk and it will safely remove the usb disk
i hope i could explain it
Prerak Patel 1-Jul-11 4:30am    
You can download the source and get any function, and if it is not there, you can create with help of that code.
Sergey Alexandrovich Kryukov 3-Jul-11 1:26am    
I agree with Prerak. OP, please look at the name of the article -- the code is there.
--SA
jsharrison 13-Jul-11 20:13pm    
Hi, I have to also agree with Prerak, this is not a simple task and there is no single function you can call to safely remove a USB disk. I recently wrote some software to allow users to format or delete files from a memory stick and searched high and low for how to do this and found the code in the article you’ve read to be the only way to be able to safely remove USB disks.

I am thinking about posting an article about what I found and this could include a DLL that has such a function (ie EjectDisk(driveLetter)) for those not wanting to dig into the lower level stuff, if you are interested?

-JH

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900