Unmounting USB Drive/s
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Hey Peeps
I am making an app that reads USB Devices, I have the accessing USB devices running fine,and the Formatting of Devices, But How do i code my app to Unmount USB Devices?? Like you do normally on the taskbar, But i want mine coded on a Button..
Can anyone help?
150 Credits for the First Working answer cooll; That someone can give me..
Cheers
Chris
I am making an app that reads USB Devices, I have the accessing USB devices running fine,and the Formatting of Devices, But How do i code my app to Unmount USB Devices?? Like you do normally on the taskbar, But i want mine coded on a Button..
Can anyone help?
150 Credits for the First Working answer cooll; That someone can give me..
Cheers
Chris
This is not my code. It is completely taken from http://stackoverflow.com/questions/7704 ... ia-c-sharp. I just converted it.
If the listbox is empty, you have no devices you can eject. Else, select an item and click the button. You can see the results if you have explorer open.
If the listbox is empty, you have no devices you can eject. Else, select an item and click the button. You can see the results if you have explorer open.
You do not have the required permissions to view the files attached to this post.
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

Hey MrAksel
My version of VB is incompatable with the Source you uploaded :(
Can you convert it to VB 10 OR 11 ?
Chris
My version of VB is incompatable with the Source you uploaded :(
Can you convert it to VB 10 OR 11 ?
Chris
hungryhounduk wrote:Hey MrAkselOpen the folder USB Devices and open the following file: USB Devices.vbproj
My version of VB is incompatable with the Source you uploaded :(
Can you convert it to VB 10 OR 11 ?
Chris
(Not the .sln file)
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
Hey Codex
Its be coded for 4.5 framework and i cannot open it on my machine
Chris
Its be coded for 4.5 framework and i cannot open it on my machine
Chris
hungryhounduk wrote:Hey CodexTry this: http://speedy.sh/Ph3Cn/3.5-Version.zip
Its be coded for 4.5 framework and i cannot open it on my machine
Chris
I thought the 2008 version is same as 2010 one, since in 2010 it asks you if you want to retarget for .NET 4.0
(The credit goes to MrAksel's link)
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
Im sorry. I forget that VS 11 defaults to .NET 4.5. You should be able to open the .vb files though and add it to another project. You could add the USBEject.vb file to any solution, then use this to eject a device:
Code: Select all
Dim eject As New USBEject("F:\") 'No matter if you enter F:\, F: or just F"
If Not eject.Eject() Then MessageBox.Show("Something failed")
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

Try this: http://speedy.sh/Ph3Cn/3.5-Version.zipHey that link is not working
I thought the 2008 version is same as 2010 one, since in 2010 it asks you if you want to retarget for .NET 4.0
(The credit goes to MrAksel's link)
I will try what MrAksel says above and let you know if it works ok
Chris
hungryhounduk wrote:Click the link and then click the "3.5 Version.zip" link.Try this: http://speedy.sh/Ph3Cn/3.5-Version.zipHey that link is not working
I thought the 2008 version is same as 2010 one, since in 2010 it asks you if you want to retarget for .NET 4.0
(The credit goes to MrAksel's link)
I will try what MrAksel says above and let you know if it works ok
Chris

Here is a mirror if for some reason that website doesn't load: http://www.mediafire.com/?3vce2vpov27ysk4
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
Hey
Ok it worked of sorts ;)
If i have a USB Stick attached, it will recognise it
If i select my drive letter in the list and click the button, the USB stick blinks.
iF I exit and restart it's not visible in the list
But
The Icon on the Taskbar is still showing and I still have to eject it manually by clicking the icon and doing it the normal way.......So having done it once with the program, I have to do it again...
Is there any way to just do it once and close the Icon on the taskbar at the same time??
Chris
Ok it worked of sorts ;)
If i have a USB Stick attached, it will recognise it
If i select my drive letter in the list and click the button, the USB stick blinks.
iF I exit and restart it's not visible in the list
But
The Icon on the Taskbar is still showing and I still have to eject it manually by clicking the icon and doing it the normal way.......So having done it once with the program, I have to do it again...
Is there any way to just do it once and close the Icon on the taskbar at the same time??
Chris
Copyright Information
Copyright © Codenstuff.com 2020 - 2023