P
Principiante
First of all, pardon my bad English.
My problem is that in my aplications I make copys of security for the
data in a usb pen drives. When you connect a pen drive, appears a new
drive unit (for example F: ). Well, in the customers computers I have
seen what unit letter appears and I have put it in the code to make the
copy directly.
The problem is that, if the customer connect a digital camera before
than the pen drive, the camera creates the "new drive unit" that I have
in the code.
The idea is to diference or to know wich kind of device is in any drive
unit.
I have used this code:
'**************************************************
Dim FsoFile As Object 'Tipe FileSystemObject
Dim Unidad As Object 'Tipe UNidad(Drive)
Set FsoFile = CreateObject("Scripting.FileSystemObject")
For Each Unidad In FsoFile.Drives
If Unidad.drivetype = 1 Then
'Floppy Disk
MsgBox "DriveType = " & Unidad.drivetype
MsgBox "Path = " & Unidad.Path
MsgBox "Driveletter " & Unidad.driveletter
MsgBox "Isready = " & Unidad.IsReady
MsgBox "Totalsize = " & Unidad.Totalsize
MsgBox "Filesystem = " & Unidad.FileSystem
End If
If Unidad.drivetype = 2 Then
'Hard disk
MsgBox "Hard Disk " & Unidad.driveletter
End If
If Unidad.drivetype = 4 Then
'CD/DVD
MsgBox "CD/DVD " & Unidad.driveletter
End If
Next
Set FsoFile = Nothing
'*****************************************************
The problem is that the camera and the pen drive are DriveType = 1 and
FileSystem = FAT to me. I can't diference the devices with the Totalsize
because they can be the same. If someone want to prove and tell what is
the result....
Well, if someone knows how to diference the devices or any other idea...
Thanks.
Principiante.
My problem is that in my aplications I make copys of security for the
data in a usb pen drives. When you connect a pen drive, appears a new
drive unit (for example F: ). Well, in the customers computers I have
seen what unit letter appears and I have put it in the code to make the
copy directly.
The problem is that, if the customer connect a digital camera before
than the pen drive, the camera creates the "new drive unit" that I have
in the code.
The idea is to diference or to know wich kind of device is in any drive
unit.
I have used this code:
'**************************************************
Dim FsoFile As Object 'Tipe FileSystemObject
Dim Unidad As Object 'Tipe UNidad(Drive)
Set FsoFile = CreateObject("Scripting.FileSystemObject")
For Each Unidad In FsoFile.Drives
If Unidad.drivetype = 1 Then
'Floppy Disk
MsgBox "DriveType = " & Unidad.drivetype
MsgBox "Path = " & Unidad.Path
MsgBox "Driveletter " & Unidad.driveletter
MsgBox "Isready = " & Unidad.IsReady
MsgBox "Totalsize = " & Unidad.Totalsize
MsgBox "Filesystem = " & Unidad.FileSystem
End If
If Unidad.drivetype = 2 Then
'Hard disk
MsgBox "Hard Disk " & Unidad.driveletter
End If
If Unidad.drivetype = 4 Then
'CD/DVD
MsgBox "CD/DVD " & Unidad.driveletter
End If
Next
Set FsoFile = Nothing
'*****************************************************
The problem is that the camera and the pen drive are DriveType = 1 and
FileSystem = FAT to me. I can't diference the devices with the Totalsize
because they can be the same. If someone want to prove and tell what is
the result....
Well, if someone knows how to diference the devices or any other idea...
Thanks.
Principiante.