Can I use sysinfo object to determine the drive letter of the flash drive? Thanks for the help.
[QUESTION] Drive Letter of Flash Drive
Page 1 of 15 Replies - 325 Views - Last Post: 11 February 2013 - 09:49 PM
Replies To: [QUESTION] Drive Letter of Flash Drive
#2
Re: [QUESTION] Drive Letter of Flash Drive
Posted 10 February 2013 - 11:34 AM
You can use WMI to get this information.
#3
Re: [QUESTION] Drive Letter of Flash Drive
Posted 10 February 2013 - 11:52 AM
You can use the FileSystemObject to check the DriveType (IF YOU ARE USING VB6..?)
MSDN
A flash drive would return 1 (Removable). You can loop through all drives:
Does WMI return more information other than "Removable"?
Function ShowDriveType(drvpath)
Dim fso, d, t
Set fso = CreateObject("Scripting.FileSystemObject")
Set d = fso.GetDrive(drvpath)
Select Case d.DriveType
Case 0: t = "Unknown"
Case 1: t = "Removable"
Case 2: t = "Fixed"
Case 3: t = "Network"
Case 4: t = "CD-ROM"
Case 5: t = "RAM Disk"
End Select
ShowDriveType = "Drive " & d.DriveLetter & ": - " & t
End Function
MSDN
A flash drive would return 1 (Removable). You can loop through all drives:
Sub CheckDriveTypes()
Dim fso As New FileSystemObject
Dim ds As Object
'loop through all drives
For Each ds In fso.Drives
Debug.Print ds.DriveLetter
Debug.Print ds.DriveType
Next ds
End Sub
Does WMI return more information other than "Removable"?
This post has been edited by andrewsw: 10 February 2013 - 11:53 AM
#4
Re: [QUESTION] Drive Letter of Flash Drive
Posted 11 February 2013 - 07:03 PM
Quote
Does WMI return more information other than "Removable"?
#5
Re: [QUESTION] Drive Letter of Flash Drive
Posted 11 February 2013 - 07:14 PM
BobRodes, on 11 February 2013 - 07:03 PM, said:
Quote
Does WMI return more information other than "Removable"?
I assumed it would do
Quote
External hard disk media
Removable media other than floppy
Fixed hard disk media
Format is unknown
Removable media other than floppy
Fixed hard disk media
Format is unknown
Although, I haven't seen a floppy-drive for a while
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|