By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,424 Members | 1,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,424 IT Pros & Developers. It's quick & easy.

Windows management Instrumentation

P: n/a
Hi,

using the Windows management Instrumentation interface (WMI) do I get illogical results :

the following works :
ManagementObject account = new ManagementObject
("Win32_logicaldisk.deviceid=\"c:\"");
account.Get();
lblName.Text = account["size"].ToString();

but the following gives me an exception
System.Management.ManagementException: Invalid object path

ManagementObject account = new ManagementObject
("Win32_Account.name=\"a_user\"");
account.Get(); // exception is thrown here

The class-name is correct though.
Any ideas ?

thanks
Chris

************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Chris,

Before we are looking to deep, did you know that there is an environment
class with what you can get as well a a lot of information (by instance the
user) and which is much easier to handle?

http://msdn.microsoft.com/library/de...mberstopic.asp

Cor
Nov 16 '05 #2

P: n/a
hi Cor,

ok, thanks. I'll have a look

but i'm still wondering why my sample code doesn't work.
any ideas ?

Chris

************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Nov 16 '05 #3

P: n/a
Chris,

I don't know I think that it has to do with authorisations
However that deep I never went in it.

Cor
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.