1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
Function IsUSB(strSource) As Boolean
Dim vSysFile, vVolume
Set vSysFile = CreateObject("Scripting.FileSystemObject")
Set vVolume = vSysFile.GetDrive(vSysFile.GetDriveName _
(vSysFile.GetAbsolutePathName(strSource)))
If vVolume.DriveType = 1 Then
IsUSB = True
Else
IsUSB = False
End If
Set vSysFile = Nothing
Set vVolume = Nothing
End Function
Public Function InfoDesDisques(Support)
Dim Serial As Long, VName As String, FSName As String
VName = String$(255, Chr$(0))
FSName = String$(255, Chr$(0))
GetVolumeInformation Support, VName, 255, Serial, 0, 0, FSName, 255
VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1)
FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1)
MsgBox "The Volume name of '" + Support + "' is '" + VName + "', the File system name of '" + Support + "' is '" + FSName + "' and the serial number of '" + Support + "' is '" + Trim(str$(Serial)) + "'", vbInformation + vbOKOnly, "toto"
End Function |
Partager