Windows Scripting
  Home arrow Windows Scripting arrow Page 3 - A Portable Scripting Toolbox
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

A Portable Scripting Toolbox
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2008-08-27

    Table of Contents:
  • A Portable Scripting Toolbox
  • Every script author needs a good editor!
  • What's the object here?
  • Put your library in your pocket
  • Don't reinvent the wheel

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    A Portable Scripting Toolbox - What's the object here?


    (Page 3 of 5 )

    Probably the single hardest challenge any scripter has to face is finding the right objects and methods to perform the task.  There's no easy way to do this and it often requires some time spent searching the Internet or leafing through endless pages of documentation.

    Many times you may know the object you need but forget the method or property name.  Or you may even know the name and forget the proper parameters.  This is when object browsers come in handy.  They can examine COM objects and other elements and expose their methods, properties, and events by reading the type library associated with the object.

    Typically, they can tell you what objects are available, enumerate their methods and properties, and also document each of the methods and properties to tell you what data types are involved.  Manually examining these objects is the only way to find the information you need when the original documentation is not available.

    For examining most objects I rely almost solely on Mark Pryor's TLViewer.

    TLViewer

    TLViewer is a lightweight, stand alone object viewer written in VB6 that was designed with scripting in mind.  It only exposes those interfaces that are available to scripters so there's no need to wade through a bunch of senseless information that's utterly and completely useless to you.

    One major advantage of TLViewer is that you can find objects by searching by ProgID, ProgID help string, or by Type Library help string.  This is a major plus.  Most object browsers that I've come across do not let you find objects based on ProgID-and that's how most scripters know them!

    TLViewer's only dependency is TLBINF32.DLL, which can be downloaded from the program's home page.  This does not need to be installed on host systems; you can simply drop it in the program directory and it will run perfectly, making this a great portable object browser.

    K-Soft WMI Explorer and Sapien WMI Explorer

    A large portion of system administration scripts rely on Windows Management Instrumentation (WMI).  Finding the correct WMI classes and associated methods, properties, and instances can also be a nightmare for scripters without access the MSDN.

    K-Soft and Sapien both offer utilities called WMI Explorer.  If you're wondering why I've provided both, it's because I use both.  The basic purpose of these two applications is the same.  Both allow you to browse WMI namespaces and view the properties and their current settings for specific instances.  However, it's where they differ that makes a difference.

    • Scope - Sapien's WMI Explorer will allow you to browse all WMI classes while K-Soft's version only allows the standard CIMV2 namespace. 
    • Methods - Sapien's WMI Explorer will also enumerate the methods associated a class where K-Soft's won't.
    • Queries - K-Soft's WMI Explorer will allow you to test and run queries within the browser.  Sapien's will not.

    Overall, the Sapien WMI Explorer is a much more complete tool, but I keep K-Soft's version around for times when I need to experiment with queries.

    Windows also provides a built-in tool called Wbemtest that can be used to browse WMI namespaces.  Just type Wbemtest in the Run... dialog box to get started.

    PowerShell developers might also want to check out the PowerShell WMI Explorer, a WMI browser designed with PowerShell users in mind.

    More Windows Scripting Articles
    More By Nilpo


       · Often times I am required to put together Windows scripts on-site at a moment's...
     

    WINDOWS SCRIPTING ARTICLES

    - More Windows Scripting Workarounds from Nilpo
    - Overloading Methods and More in VBScript
    - Improving MFC for Windows Vista
    - Regular Expressions in VBScript
    - Working with Dates in WMI
    - Completing Calendars with VBScript Date Func...
    - Building Calendars with VBScript Date Functi...
    - Working With Dates and Times in VBScript
    - Designing WCF DataContract Classes Using the...
    - Understanding Dates and Times in VBScript
    - Working With Arrays in VBScript
    - Compressed Folders in WSH
    - Using .NET Interops in VBScript
    - Nilpo`s Scripting Secrets, Vol I
    - Database operations using Silverlight 2.0 WC...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    Stay green...Green IT