News Stay informed about the latest enterprise technology news and product updates.

Windows scripting for beginners

Windows scripting is simpler than it looks and can save you substantial time and effort. Here are some basic scripting concepts by scripting authority Christa Anderson.

Many people find the idea of administrative scripting intriguing, but also intimidating. This is especially the case if you're not sure what you can accomplish with a script that you can't accomplish from a GUI. You may fear that the learning curve will be excessive, and if you've decided that scripting is too arcane to bother with, you're not alone.

However, scripting is a lot simpler than it looks. If you begin at the beginning, you can save yourself substantial time and effort.

My new column will help you learn to script in small steps. In today's premiere column, I'll explain when to script a task, and I will introduce some basic concepts you'll find useful. Next month we'll explore some more advanced concepts: procedures and operations, and I will expand on the basic concept of objects. I'll refer to these columns in later columns as we develop working scripts.

Once I've introduced the concepts, this column will look at how to use VBScript to perform common tasks by first introducing the task to accomplish and then walking you through the code. The tasks I'll illustrate are based on real tasks, so I encourage you to send me questions, with a couple of caveats: This column can't provide scripts for every occasion, and I can't provide extensive debugging support through e-mail.

I encourage you to think of this column as a serialized book that can respond to your questions. If you need something clarified, ask. You're probably not the only person with that question. You can e-mail your questions to

Why Script?
The main reason to script is to automate repetitive tasks such as changing a password for a user. Scripting tasks let you perform them quickly and consistently and even allow you to delegate tasks to inexperienced administrators. If you're only going to perform a task once, then scripting it doesn't usually make any sense -- by the time you've scripted it, you could be done.

Scripting can also provide functionality that's not available through the graphical interface. The operating system can do many things that the GUI doesn't support, just because including everything in a dialog box would clutter the GUI into an unreadable mess. Actually, though, those features are available -- you just have to make them accessible.

Command-line tools found in the OS or as part of the Resource Kit are an alternative to scripting, but they're not as flexible as the more modular VBScript. You don't have to choose between existing command-line tools and the ones you create; however, it's possible to call on existing programs from a script.

I'm going to begin by defining some key terms. I will also cover scripting hosts, how to interpret scripts and the kinds of data types you will use.

Beginner's guide to scripting
- Introduction
- Objects, properties and methods
- Scripting hosts and the interpreter
- How are scripts interpreted?
- Data types you'll use
- Summary

About the Author: Christa Anderson is the author of Windows Terminal Services and The Definitive Guide to MetaFrame XP. She is also co-author of the book Mastering Windows 2003 Server.

Dig Deeper on Windows Server deployment

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.