can someone point me right direction?? maybe i am missing something in
Win32_* can will do what i am looking for...
-thankz
You will want to check out the following WMI classes:
Win32_USBControllerDevice
Win32_SCSIControllerDevice
Win32_IDEControllerDevice
I can't find anything for the PCI slots, but I am sure there is
something in there.
The classes listed above should give you the items that are connected to
these controllers.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nicholas...@exisconsulting.com
"John Smith" <som...@microsoft.com> wrote in message
news:u62YxSr$CHA....@TK2MSFTNGP10.phx.gbl...
ok this is what i am trying....
[Code lang="C#"]
ObjectQuery oq =
new System.Management.ObjectQuery("SELECT * FROM
Win32_IDEControllerDevice");
ManagementObjectSearcher query =
new ManagementObjectSearcher(oq);
ManagementObjectCollection queryCollection = query.Get();
foreach ( ManagementObject mo in queryCollection)
{
Console.WriteLine("Antecedent : "+mo["Antecedent"]);
Console.WriteLine("Dependant : "+mo["Dependent"]);
}
[/Code]
now the "Dependent" is a CIM_LogicalDevice reference, how do i get the value
for its(CIM_LogicalDevice) properities like "Caption" and all the other
good stuff ...
[Output]
Antecedent :
\\JAGERMEISTER\root\cimv2:Win32_IDEController.DeviceID="PCI\\VEN_8086&DEV_24
CB&SUBSYS_01471028&REV_02\\3&13C0B0C5&0&F9"
Dependant :
\\JAGERMEISTER\root\cimv2:Win32_PnPEntity.DeviceID="PCIIDE\\IDECHANNEL\\4&1D
C52276&0&0"
Antecedent :
\\JAGERMEISTER\root\cimv2:Win32_IDEController.DeviceID="PCI\\VEN_8086&DEV_24
CB&SUBSYS_01471028&REV_02\\3&13C0B0C5&0&F9"
Dependant :
\\JAGERMEISTER\root\cimv2:Win32_PnPEntity.DeviceID="PCIIDE\\IDECHANNEL\\4&1D
C52276&0&1"
Antecedent :
\\JAGERMEISTER\root\cimv2:Win32_IDEController.DeviceID="PCIIDE\\IDECHANNEL\\
4&1DC52276&0&0"
Dependant :
\\JAGERMEISTER\root\cimv2:Win32_PnPEntity.DeviceID="IDE\\DISKMAXTOR_6E030L0_
_________________________NAR61590\\31454633435A4551202020202020202020202020"
Antecedent :
\\JAGERMEISTER\root\cimv2:Win32_IDEController.DeviceID="PCIIDE\\IDECHANNEL\\
4&1DC52276&0&1"
Dependant :
\\JAGERMEISTER\root\cimv2:Win32_PnPEntity.DeviceID="IDE\\CDROMSAMSUNG_CD-ROM
_SC-148C__________________B105____\\5&1202A50F&0&0.0.0"
[/Output]
"Nicholas Paldino [.NET/C# MVP]" <nicholas...@exisconsulting.com> wrote
in message news:OagBXXr$CHA....@TK2MSFTNGP12.phx.gbl...
You should be able to access it like any other property, like this:
foreach ( ManagementObject mo in queryCollection)
{
Console.WriteLine("Antecedent : "+mo["Antecedent"]);
Console.WriteLine("Dependant : "+mo["Dependent"]);
Console.WriteLine("Caption : "+mo["Caption"]);
}
It should work.
--
- Nicholas Paldino [.NET/C# MVP]
- nicholas...@exisconsulting.com
"John Smith" <som...@microsoft.com> wrote in message
news:uC5wKPs$CHA....@TK2MSFTNGP10.phx.gbl...
Unhandled Exception: System.Management.ManagementException: Not found
at
System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus
errorCode)
at System.Management.PropertyData.RefreshPropertyInfo()
at System.Management.PropertyData..ctor(ManagementBaseObject parent, String
propName)
at System.Management.PropertyDataCollection.get_Item(String propertyName)
at System.Management.ManagementBaseObject.GetPropertyValue(String
propertyName)
at System.Management.ManagementBaseObject.get_Item(String propertyName)
at SampleWinApp.Form1.devices() in c:\documents and settings\alok khanna\my
documents\visual studio projects\samplewinapp\form1.cs:line 54
at SampleWinApp.Form1..ctor() in c:\documents and settings\alok khanna\my
documents\visual studio projects\samplewinapp\form1.cs:line 31
at SampleWinApp.Form1.Main() in c:\documents and settings\alok khanna\my
documents\visual studio projects\samplewinapp\form1.cs:line 120The program
'[2884] SampleWinApp.exe' has exited with code 0 (0x0).
"Nicholas Paldino [.NET/C# MVP]" <nicholas...@exisconsulting.com> wrote
in message news:ukcaZds$CHA....@TK2MSFTNGP12.phx.gbl...
I checked the Win32_IDEControllerDevice WMI class, and there is no
Caption property on it, or anywhere on the heiarchy tree.
--
- Nicholas Paldino [.NET/C# MVP]
- nicholas...@exisconsulting.com
"John Smith" <som...@microsoft.com> wrote in message
news:uJvdWis$CHA....@TK2MSFTNGP11.phx.gbl...
the caption property is for the CIM_LogicalDevice (link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/
cim_logicaldevice.asp )... and since the "dependent" property is a reference
to that class, there is should be a way to get the caption property for the
dependent property
"Nicholas Paldino [.NET/C# MVP]" <nicholas...@exisconsulting.com> wrote
in message news:OUtKVls$CHA....@TK2MSFTNGP10.phx.gbl...
If the property is returning a string, you can perform a query of all
instances of CIM_LogicalDevice where the DeviceID is equal to the Dependent
property.
--
- Nicholas Paldino [.NET/C# MVP]
- nicholas...@exisconsulting.com
"John Smith" <som...@microsoft.com> wrote in message
news:eilvJqs$CHA....@TK2MSFTNGP12.phx.gbl...
the deviceID property is only for the CIM_LogicalDevice which i can't seem
to get too..
but maybe i am missing something... can u give me a code example...
thankz for all the quick replies...
"Nicholas Paldino [.NET/C# MVP]" <nicholas...@exisconsulting.com> wrote
in message news:#fozGws$CHA....@TK2MSFTNGP11.phx.gbl...
It's like a join between two database tables. The Dependent property is
returning an id (foreign key) which corresponds to the DeviceID property on
instances of CIM_LogicalDevice (the primary key). So you have to formulate
a new query that will select the appropriate instances from
CIM_LogicalDevice where the DeviceID is whatever the Dependent is, like
this:
select * from CIM_LogicalDevice where DeviceID = <Dependent>
--
- Nicholas Paldino [.NET/C# MVP]
- nicholas...@exisconsulting.com
"John Smith" <som...@microsoft.com> wrote in message
news:O2b244s$CHA...@TK2MSFTNGP10.phx.gbl...
"Nicholas Paldino [.NET/C# MVP]" <nicholas...@exisconsulting.com> wrote
in message news:#4vxSKt$CHA....@TK2MSFTNGP11.phx.gbl...