You are here:About>Computing & Technology>Visual Basic> Learn VB 6> Learn VBScript> VBScript - The System Administrator's Language - Part 1
About.comVisual Basic
Newsletters & RSSEmail to a friendSubmit to Digg
Elsewhere on the Web

Download WSHWSH Objects

VBScript - The System Administrator's Language - Part 1

From Dan Mabbutt,
Your Guide to Visual Basic.
FREE Newsletter. Sign Up Now!

Running the Example ... and what's next

Run VBScript with CScript
Run VBScript with CScript

To try out this script, simply copy and paste it into Notepad. Then save it using any name ... such as "CreateLink.vbs". Remember that Notepad will add ".txt" to files automatically in some cases and the file extension must be ".vbs" instead. Then double click the file. A shortcut should appear on your desktop. If you do it again, it just recreates the shortcut. You can also start the DOS Command Prompt and navigate to the folder that the script was saved in and run it with the command ...

cscript scriptfilename.vbs

... where "scriptfilename" is replaced with the name you used to save it. See the example shown in the screenshot above.

Give it a try!

One caution: Scripts are used a great deal by viruses to do bad things to your computer. To combat that, your system may have software (such as Norton AntiVirus) that will flash a warning screen when you try to run this script. Just select the option that allows this script to run.

Although using VBScript in this mode is great, the real payoff for most people comes in using it to automate systems like WMI (Windows Management Instrumentation) and ADSI (Active Directory Service Interfaces). In the next segment of this lesson, we take a closer look!

  1. Introducing VBScript
  2. VBScript "Hosts"
  3. Clearing up some "points of confusion"
  4. WSH Objects
  5. The Example Code
  6. Running the Example ... and what's next

<< Previous | Next

 All Topics | Email Article | | |
Advertising Info | News & Events | Work at About | SiteMap | Reprints | HelpOur Story | Be a Guide
User Agreement | Ethics Policy | Patent Info. | Privacy Policy©2008 About, Inc., A part of The New York Times Company. All rights reserved.