473,473 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Available WMI queries for ManagementObject

2 New Member
Hello,

Where can I find informations on which WMI queries are in fact available for .NET interface through ManagementObjectSearcher. The command below returns exception for "Win32_LogicalDisk", but works for "Win32_Environment".
Every reference in msdn directs to msdn library, which contains all Win32 and COM development classes (that seems not to be available from vb .net code):

Expand|Select|Wrap|Line Numbers
  1. Dim info As ManagementObject
  2.  
  3.         ' Build a query for enumeration of
  4.         ' Win32_Environment(instances)
  5.         Dim query As New SelectQuery("Win32_LogicalDisk")
  6.  
  7.         ' Instantiate an object searcher with this query
  8.         Dim searcher As New ManagementObjectSearcher(query)
  9.  
  10.         ' Call Get() to retrieve the collection of
  11.         ' objects and loop through it
  12.         Dim envVar As ManagementObject
  13.         For Each envVar In searcher.Get()
  14.             TextBox1.Text += "Variable : " & envVar("VariableValue").ToString & vbCrLf
  15.         Next
  16.  
Any help is appreciated.

Thanks in advance!
Aug 6 '09 #1
2 10223
PRR
750 Recognized Expert Contributor
You can download WMI code creator. This will pretty much do everything for you...
Aug 7 '09 #2
thiagoalencar22
2 New Member
That is just what I needed!
Thank you very much!

BR,
Thiago
Aug 7 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Brian Piscopo | last post by:
Memory leak and .NET -- like oil and water :- I've written a distributed system for parallel processing of large tasks. Each machine has an agent on it that sends processor usage information back...
3
by: serge calderara | last post by:
Dear all, I need to check the availbale disk space. For that I have used following code : m_diskMngt = New ManagementObject("win32_logicaldisk.deviceid=""E:""") This works fine but as my...
3
by: Lamont | last post by:
VB.NET Can anyone tell me how I can get the Drive Space information from a remote computer on the same domain and physical network? Primarily I need the Total disk space and space used or free...
5
by: David Clegg | last post by:
I initially posted this to .Framework.WMI a week ago but am yet to have a response... I am having trouble changing properties of a Windows Service application using the ManagementObject class...
3
by: Steve Teeples | last post by:
I would like to display in a listbox all possible paths that can be fed into the ManagementClass constructor (e.g., Win32_Enviroment, Win32_OperatingSystem, etc.) Can someone steer me in the...
3
by: Daniel | last post by:
in C# how do i get to total number of kilobytes of memroy total and available for the current machine?
9
by: scsharma | last post by:
hi, I am trying following code. string fileObject = @"C:\Documents and Settings\myfolder\Temp.txt"; ManagementBaseObject ret = null; ManagementPath path = new ManagementPath( ); path.Server =...
0
by: Scupper | last post by:
I am using the System.Management namespace for the first time and I cannot get the ManagementObject.SetPropertyValue method to work properly. I am trying to change the ServerName and ShareName...
2
by: DBC User | last post by:
Hi all, I am in a situation where I need to find the a unc path of a particular drive or I have a unc path, I need to find the drive. Either way will work. I do not want to use dllimport to make...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
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.