1. Home
  2. Computing & Technology
  3. Visual Basic

VBScript - The System Administrator's Language - Part 1

By , About.com Guide

4 of 6

WSH Objects

WSH is even more powerful when you use objects for things like managing a network or updating the registry. Click here for a list of the objects that are part of WSH from Microsoft. This list is "incomplete" in the sense that it leaves out some of the most valuable ways that you can use WSH, especially for administering Windows. We'll work on that in the next segment of this tutorial, however.

On the next page, you'll see a short example of a WSH script (adapted from one supplied by Microsoft) that uses WSH to create a desktop shortcut to the Office program, Excel. (There are certainly easier ways to do this - we're doing it this way to demonstrate scripting.) The object this script uses is 'Shell'. This object is useful when you want to run a program locally, manipulate the contents of the registry, create a shortcut, or access a system folder. This particular piece of code simply creates a desktop shortcut to Excel. To modify it for your own use, create a shortcut to some other program you want to run. Note that the script also shows you how to set all the parameters of the desktop shortcut.

Explore Visual Basic
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB 6
  5. Learn VBScript
  6. VBScript - The System Administrator's Language - Part 1

©2009 About.com, a part of The New York Times Company.

All rights reserved.