473,513 Members | 2,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem accessing WMI class win32_NetworkAdapterConfiguration

I have some code that uses the WMI class win32_NetworkAdapterConfiguration
to access each adapter in a system. On 99% of the systems the code seems to
work. On a very few the code fails when trying to access the WMI object.
Here's the code:

ManagementClass objMC = new
ManagementClass("Win32_NetworkAdapterConfiguration ");
ManagementObjectCollection adapters = objMC.GetInstances();
foreach (ManagementObject adapter in adapters)
...
The call to objMC.GetInstances fails. The error message (via a try/catch) is
simple "Not found" which is basically useless. The computer in question is a
student notebook with all sorts of extras installed, but I don't see
anything obvious that would interfere with WMI. The WMI service is also
running. Google searches have so far come up dry, but I don't have a very
useful item to key my search on. Has anyone got any suggestions on what
might be causing this problem?
Nov 17 '05 #1
2 3749

"Paul Steele" <pa*********@acadiau.ca> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
I have some code that uses the WMI class win32_NetworkAdapterConfiguration
to access each adapter in a system. On 99% of the systems the code seems to
work. On a very few the code fails when trying to access the WMI object.
Here's the code:

ManagementClass objMC = new
ManagementClass("Win32_NetworkAdapterConfiguration ");
ManagementObjectCollection adapters = objMC.GetInstances();
foreach (ManagementObject adapter in adapters)
...
The call to objMC.GetInstances fails. The error message (via a try/catch)
is simple "Not found" which is basically useless. The computer in question
is a student notebook with all sorts of extras installed, but I don't see
anything obvious that would interfere with WMI. The WMI service is also
running. Google searches have so far come up dry, but I don't have a very
useful item to key my search on. Has anyone got any suggestions on what
might be causing this problem?


What OS are these failing systems running? Did you try to create an instance
of this class using Wbemtest.exe or a simple Vbscript?

Willy.


Nov 17 '05 #2
>>I have some code that uses the WMI class win32_NetworkAdapterConfiguration
to access each adapter in a system. On 99% of the systems the code seems
to work. On a very few the code fails when trying to access the WMI
object. Here's the code:

ManagementClass objMC = new
ManagementClass("Win32_NetworkAdapterConfiguration ");
ManagementObjectCollection adapters = objMC.GetInstances();
foreach (ManagementObject adapter in adapters)
...
The call to objMC.GetInstances fails. The error message (via a try/catch)
is simple "Not found" which is basically useless. The computer in
question is a student notebook with all sorts of extras installed, but I
don't see anything obvious that would interfere with WMI. The WMI service
is also running. Google searches have so far come up dry, but I don't
have a very useful item to key my search on. Has anyone got any
suggestions on what might be causing this problem?


What OS are these failing systems running? Did you try to create an
instance of this class using Wbemtest.exe or a simple Vbscript?


The student in question was very keen and tracked the problem down himself.
Turned out
that his WMI database was corrupted and he found this link to fix it:

http://windowsxp.mvps.org/repairwmi.htm

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1446
by: Achim Domma (Procoders) | last post by:
Hi, I have a problem with a DCOM server written in python. Here is my minimal test object: class TestObject: _reg_clsid_ = "{ECDBB3BC-F0BF-4eef-87C0-D179A928DAB5}" _reg_progid_ =...
17
2452
by: Dave | last post by:
Hi I'm making a 3D Engine which consists of the class C3DEngine. Part of this engine is a file loader, a class called CMeshLoader. I have made an instance of CMeshLoader in C3DEngine, ie...
3
4558
by: debadeepti | last post by:
Hi All, I am porting an application from watcom to vc compiler. In watcom and other compiler (other then vc) memory allocation of __vfptr inside class object are different. In vc __vfptr is...
0
3911
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
1
3932
by: Eirik Brattbakk | last post by:
Hi I have some problems accessing a soap service made in c# using an ATL/MFC client over SSL. I have tried both CSoapMSXMLInetClient and CSoapWininetClient as template arguments with my stub...
1
1156
by: muthu | last post by:
Hi guys, Iam using dot framework 2.0.vs.net2005.I created a class library project and added a class file.And also i added a app.config file.And i declared a connection string in that config...
3
4592
by: Jeff | last post by:
Hey asp.net 2.0 In the source I posted below, there is a GridView (look at the bottom of the script): <asp:GridView ID="gvwOnline" runat="server"> </asp:GridView> I'm trying to assign a...
4
1405
by: GesterX | last post by:
Hi guys, this has been bugging me for a while and I'd appreciate any help anyone could offer. Basically I am running a boating simulation and I have all of the "harder" parts done but one error is...
3
3069
by: djsuson | last post by:
I'm trying to set up an inheritance tree that also uses templates. This is an attempt to simplify some previous code that was filled with redundancies. I'm working with g++ 3.4.6. The code is split...
0
7175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7391
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7553
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7120
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7542
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5697
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.