Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Knowledge Base > Code Library > WMI Browser


Reply
 
Thread Tools Display Modes
  #1  
Old 07-20-2006, 02:46 AM
DougT's Avatar
DougT DougT is offline
Ultimate Antique

Administrator
* Expert *
 
Join Date: Sep 2005
Location: Maldon,Essex, UK
Posts: 3,939
Default WMI Browser


The Microsoft Windows Management Instrument (WMI) component offers a wealth of Management Information pertaining to your system.

Information can be accessed through a series of Classes, each of which have Properties and a sub-set of which also have executable Methods. Microsoft provide some examples of using WMI to obtain particular pieces of information from the system, a few can be found here: http://msdn2.microsoft.com/en-us/library/aa394585.aspx
Although written in VB Script it's a simple matter to convert to VB.

The attached Code is a browser type application which can be used to 'explore' implemented WMI classes. The Properties and Methods associated with a class can be displayed and the class actually executed and the results browsed. It could be of some use to those who want to find specific pieces of information (eg How many COMM ports do I have?, what are the IP Addresses assigned to my Network Adapters?, What's my Boot Configuration?)

In addition to being 'useful' the code demonstrates some coding techniques which the novice or less experienced programmer may find educational, including:
(a) Accessing WMI Objects and associated properties
(b) Recursive Routines to navigate through hierarchal structures of Objects and Properties
(c) Building TreeViews based upon the above
(d) A 'template' for accessing WMI Classes (in VB rather than VB Script as per the Microsoft examples).
It also demonstrates the use of Semi-Synchronous WMI calls with a forward only enumerator to improve response and minimise memory requirements.

There's plenty of scope for further development for those of you that wish to.

EDIT: For those of you that are interested in further development or want more information about WMI, PrOpHeT has provided these links:

WMI Code Creator

http://www.microsoft.com/downloads/d...displaylang=en

ScriptoMatic v2

http://www.microsoft.com/downloads/d...displaylang=en

ScriptoMatic v1

https://www.microsoft.com/downloads/...8-212c414a7ab0

History and Overview

http://msdn.microsoft.com/library/de...mioverview.asp
http://en.wikipedia.org/wiki/Windows...nstrumentation
Attached Files
File Type: zip WIMExplorer.zip (9.1 KB, 381 views)
__________________
semel insanivimus omnes
S Data in context = Information, S Information in context = Knowledge, S Knowledge in context = Experience
S Experience in context = Wisdom= Data

Last edited by DougT; 07-18-2007 at 01:22 AM. Reason: Changed the MSDN link (old one has gone)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->