As I said it helpd, but raises another question.
What other options are there other than Win32_LogicalDi sk? I want only
local Read/Write Disks (I wan tot create a temporary file and I am trying to
find the first disk that has enough space and I can write to).
I did a searh in the help, but came up with nothing. There is some code:
Dim diskClass As New System.Manageme nt.ManagementCl ass("Win32_Logi calDisk")
Dim disks As System.Manageme nt.ManagementOb jectCollection =
diskClass.GetIn stances()
Dim disk As System.Manageme nt.ManagementOb ject
Dim space As System.UInt64
For Each disk In disks
If CStr(disk("Name ")) = "C:" Then
space = CType(disk("Fre eSpace"), System.UInt64)
End If
Next disk
But this does not help because it is Logical disk. I know there is an
IsLocal property, but I wish there was a more direct way and also, will
IsLocal give me the CD-ROM drive, which obviously I cannot write to.
Thanx in advance,
--
Anil Gupte
www.keeninc.net www.icinema.com
"Oenone" <oe****@nowhere .comwrote in message
news:9A******** ***********@new sfe2-win.ntli.net...
Anil Gupte wrote:
>I am getting this error: Type 'System.Managem ent.ManagementC lass' is
not defined. The statement is:
Dim diskClass As New
System.Managem ent.ManagementC lass("Win32_Log icalDisk")
You need to add a reference to System.Manageme nt.dll, then it'll work.
HTH,
--
(O)enone