How to show usb drive letter when we attach my usb to my computer
we use a label or textbox and one timer
now we want to do this we start my project and attach a usb drive to my pc
the lebel or textbox show much fast my usb storage device drive letter ( I:\ or f:)
please tell me a good solution
Add Reference : Microsoft Script Runtime
Add 1 label.
Private Sub SysInfo1_DeviceArrival(ByVal DeviceType As Long, ByVal DeviceID As Long, ByVal DeviceName As String, ByVal DeviceData As Long)
Private Sub SysInfo1_DeviceRemoveComplete(ByVal DeviceType As Long, ByVal DeviceID As Long, ByVal DeviceName As String, ByVal DeviceData As Long)
Private Sub Check()
Dim FSO As New Scripting.FileSystemObject, drv As Scripting.Drive
'No Usb Detected
Label1.Caption = "Drive : -"
For Each drv In FSO.Drives
If drv.IsReady Then
If drv.DriveType = Removable Then
Label1.Caption = drv.DriveLetter & ":"
Private Sub Timer1_Timer()
Thanks Jxman code is right work but i have a problem please tell me whats wrong
when we start project the system work very slowly and second problem
we use a portable vb6 in home and use a full installation software of vb6 in my work shop
when we use a portable vb6 at home and when we start a project or compile any application the avast
antivirus say it is a malicious program and close the program
by the way this code is work just you reply what i do and we mark solve this thread