Hello!
I found a wonderful article at http://www.myengineeringworld.net/20...n-vba-wmi.html that I modified to get ONLY the device ID of the connected USB disk.
My question is :
1. The code takes a while to execute because it finds all usb connections and I need to make it real quick. How can it be modified further to loop through only disk/storage devices as I do not want any other services like HidUsb, usbhub, mouhid or other info such as name, manufacturer, status etc.
2. It prefixes additional info such as 'USB\VID_1058&PID_1023\'. How can I strip it off to get only the device ID?
3. How to convert it in a function that will return the device ID - This function can be invoked on all onClick events of other buttons to check the usb drive is connected to the computer. Eg. If chkUsb = "0123456789" Then
To conclude: I need to ensure that the USB drive is connected to the system at all times and if it is not, the other buttons in the vba program will not work.
Thanks.
![]()
Please Login or Register to view this content.
Bookmarks