D
Donald
In both VB6 and VB.NET I can search through the available drives and look
for a specific drive type (ie fixed, CD, remote). This is done with the
File System Object and other scripting objects along with a for loop:
Dim fso As New Scripting.FileSystemObject
Dim Drives As Scripting.Drives = fso.Drives
Dim Drive As Scripting.Drive
For Each Drive In Drives
If (Drive.DriveType = Scripting.DriveTypeConst.Fixed) Then
*** do something with local fixed drive only **
End If
Next
However, what if I know the drive I want to check. How do I assign the
proper letter to a single drive instance? It appears that the methods for
the drive class are read only and somehow assigned values internally during
the for loop assignment. I can't create a drive object for a given drive
letter and then access the methods like "drivetypecont" on that single
drive. What is the dotnet solution to this issue? Not just a work around.
I have a work around already.
for a specific drive type (ie fixed, CD, remote). This is done with the
File System Object and other scripting objects along with a for loop:
Dim fso As New Scripting.FileSystemObject
Dim Drives As Scripting.Drives = fso.Drives
Dim Drive As Scripting.Drive
For Each Drive In Drives
If (Drive.DriveType = Scripting.DriveTypeConst.Fixed) Then
*** do something with local fixed drive only **
End If
Next
However, what if I know the drive I want to check. How do I assign the
proper letter to a single drive instance? It appears that the methods for
the drive class are read only and somehow assigned values internally during
the for loop assignment. I can't create a drive object for a given drive
letter and then access the methods like "drivetypecont" on that single
drive. What is the dotnet solution to this issue? Not just a work around.
I have a work around already.