Link to home
Start Free TrialLog in
Avatar of jerahteo
jerahteo

asked on

Detect & Remove 'Removable Drive'

I wish to know how can I detect any removable drive be it thumb drive, pen drive, portable drive that is being plug into my computer using visual basic 6.0 code. The code should be compatible with all OS from 98 to XP.

The moment the user plug this removable drive into the computer the code should intercept the event and only upon entering the correct password then the device will be accepted and allow to be used else the device will be throw out or kick out of the system.

The reason I am doing this is to prevent other user from using removable media to transfer confidential files out of my computer.

I am not to sure as how to intercept the event and also the code should first identify that its a removalbe media drive before asking the user for password. If the device plug in is not a removable media then it will be allow to proceed. 2nd part is that once if the user did not provide the correct password, the code need to kick the device out of the system and not allow it to work further.

Thanks

ASKER CERTIFIED SOLUTION
Avatar of juliancrawford
juliancrawford

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 jerahteo
jerahteo

ASKER

Perhaps I did not make myself clear enough. Firstly I do not want other people to use any Removable media on my client station but I still need the usb port for other purpose. Therefore I cannot disable it from CMOS or even filling it with thick epoxy adhensive.

I am able to write write a program using visual basic to scan any removable drive @ every x sec but I felt that this may not be very efficient. I am looking for a code which is event driven. Mean that the code will react when the new device event kicks in the code will then be trigger upon this new event arrival as if to allow the usb device to continue or eject itself (depending on if he provide the correct password).

This link (. https://www.experts-exchange.com/questions/20571610/Disable-USB-by-W2K-policy.html
) which you have provided is in foreign language so I cannot understand.
I have found the answer to my own question. In Visual Basic 6.0 Development kit there is a component call  Microsoft SysInfo. This component has got a procedure call 'DeviceArrival', which can help me to trigger the event when a new device is plug in. Once i confirm the plug in device is of the storage media I will run excute the password checking and if the pass is verified correct then I will not eject the storage media.

Can the Administrator assist me to remove this question.

Thank you.