Limit access to a removeable drive programatically

How can I programatically limit access to a removeable drive in Windows or give access to it.  For example, I would like to password protect the drive.  If the password is supplied, let windows/current user have access to it.
bc4942Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
alainbrydenConnect With a Mentor Commented:
Oh I see. Well then I would say the best thing to do would be to encrypt the contents of that drive and add a small decryptor to your accessing program. I know that this is the "if all else fails" solution, but it may come down to that.
0
 
alainbrydenCommented:
That is something built onto a removable drive but it has nothing to do with visual basic. If you want a password protected removable drive then you need to buy a password protectable removable drive. (Most large ones come with this feature, just right click on the drive and alter it's properties)
0
 
bc4942Author Commented:
so there is no api call or anything with windows that would let you "disconnect" or "reconnect" a drive?  Interesting.
0
 
nmcdermaidCommented:
There probably is an API but the user would actually have to run your VB App to activate it...

You could put your app in the statrup but there are many ways around that.
0
 
bc4942Author Commented:
I understand...Full disclosure might be needed here..  I have created a CDROM partition on a USB key (like U3)  When the Key is inserted, 2 drives are added:  a "cd-rom" and a removeable disk (just like U3).  On the CDROM there are 2 files.  My .exe and autorun.inf.  My .exe currently scans the Windows removeable drives to find the one that is the key and then executes a custom menu of items on the key (similar to U3).  Looking to limit access to that dive.
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.