> I have this to search every diskdrive there is on a computer.
> But now I want to show/acces only 1 diskdrive for example only the C:\
[quoted text clipped - 11 lines]
>
> }
I know my SQL so there is not my problem, it's that this "function" is
expacting more results then it gets.
>> I have this to search every diskdrive there is on a computer.
>> But now I want to show/acces only 1 diskdrive for example only the C:\
[quoted text clipped - 19 lines]
>
> Willy.
Willy Denoyette [MVP] - 30 Sep 2005 14:54 GMT
Ok I see, you are using the Win32_DiskDrive class which denotes a physical
drive, so it's 'DeviceID' property contains the physical device name like:
\\\\.\\PHYSICALDRIVE0. A physical drive has no associated drive letter, as
it can hold one or more partitions that each are logical drives that can
have associated drive letters.
What you are looking for (I guess) is the drive letter, in this case you
should use the Win32_LogicalDisk class.
Starting with the Win32_LogicalDisk you can get at the corresponding
partition by querying for the associators of the Win32_LogicalDisk, one you
have the associated partition (win32_diskpartition) you can get at the
win32_diskdrive by querying for it's associators.
Willy.
>I know my SQL so there is not my problem, it's that this "function" is
>expacting more results then it gets.
[quoted text clipped - 22 lines]
>>
>> Willy.