Copying a file to usb-based storage media from VB.Net 2008

My application is a VB.Net application in .net 3.5. I have given a feature for backing up sql database. This creates a .bak file. Now I want to give facility to my user to copy this .bak file on pen/flash drive or USB-based hard-disk. For this:
1. How can I scan the system hardware to find if any USB-based removable storage media is connected?
2. Once that is found, I want to display these drive list from (1) above  in the listbox. Then the user will select the drive.
3. How to check if the selected usb-storage has sufficient space?
4. How to copy my .bak file on this usb-storage?

Regards,
MI
vj_miAsked:
Who is Participating?
 
imaki06Connect With a Mentor Commented:
There is an example here.

However it does not see whether that is really an USB-drive. But only if the drivetype is removable..
0
 
vj_miAuthor Commented:
But in that case, even Cd/DVD is considered removable. But copy function will not work in that case.

Regards,
MI
0
 
imaki06Commented:
There is another function SetupDiGetDeviceRegistryProperty which could be used to get more info on those volumes.

But I do not know how to use it. I just found one example. The example can be found from comments (almost last one).
0
 
Kalpesh ChhatralaSoftware ConsultantCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.