Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Appendix B. Accessing WMI from Other Languages

Appendix B. Accessing WMI from Other Languages

This book has investigated WMI from a VBScript perspective. We chose this language because it is relatively easy to learn, an interpreter for it ships with Windows 2000 as standard under the auspices of the Windows Scripting Host, and there is a good chance that it will be reasonably familiar to you. Apart from the minority of discussions that specifically focused on using the VBScript language itself, the concepts and techniques covered in this book stand independent of any particular language. After all, the whole point of WMI is that it presents a unified interface to computer management that stands independent of any particular language or even platform.

This appendix, therefore, is devoted to a brief demonstration of how WMI objects can be accessed from three languages commonly used for scripting or building quick solutions. Specifically, it demonstrates the use of WMI from within JScript, Perl, and Visual Basic. The demonstration focuses on two short scripts that contain an example of connecting the WMI service on a machine, retrieving a collection of objects, iterating through that collection, reading a property, and responding to an event. We are emphatically not providing a tutorial on how to program in JScript, Perl, or VB, or even a full tutorial on programming WMI from these languages. Instead, the intention is to give anyone already familiar with one of these languages a quick start in writing WMI-savvy code.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint