Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


May 2004

Time for a Windows Scripting Overhaul

Microsoft's primary scripting technologies are in need of a major update
RSS
Subscribe to Windows IT Pro | See More VBScript Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Scripting occupies the gray area between administration and programming. Used primarily by administrators, scripting lets them quickly and efficiently perform routine tasks in a way that's less prone to errors than using a GUI is.

Although it requires many of the same skills that programming does, a scripting project's scope is typically much smaller than that of a true programming endeavor. Scripting tasks are usually very focused actions (e.g., adding a user or printer), and scripting a solution doesn't require the level of complexity and power that a full-blown programming effort demands. And, because the script writer is often an administrator, error handling and UI concerns aren't the formidable considerations that they are in most end-user-oriented programming applications.

These differences mean that script writers need a different set of tools than programmers do. Microsoft provides a set of scripting tools, but those technologies are in need of a major update.

A Tale of Two Technologies
The two primary Microsoft scripting technologies for Windows administrators are command shell scripting and Windows Script Host (WSH)/VBScript. In spite of my familiarity with and fondness for command shell scripting, calling that technology a bit long in the tooth is more than an understatement. Although Microsoft pays lip service to the continued importance of command shell scripting, it's the stepchild in the family of Microsoft scripting technologies—Microsoft doesn't even mention command shell scripting in the 1200-plus-page Microsoft Windows 2000 Scripting Guide. But administrators like command shell scripting for its ease of use—it's simpler than most other scripting technologies and doesn't put big hurdles in the path of prospective script writers. However, the technology is outdated and isn't as powerful as it needs to be. Command shell scripting incorporates very little in the way of flow control and logic and offers no debugging tool to speak of other than using the Echo command.

Despite being Microsoft's favored scripting technology, WSH/VBScript never took the world by storm. Many administrators consider WSH/VBScript to be too much like Visual Basic (VB), complete with all the complexities of a programming language. Although WSH/VBScript is far more capable than command shell scripting, it lacks built-in functionality and too frequently relies on external COM objects. Sure, learning the VBScript syntax is relatively easy. But before you can solve your problem, you need to find the necessary COM objects and learn how to use them—and some of those objects, such as Microsoft Active Directory Service Interfaces (ADSI) and Windows Management Instrumentation (WMI), aren't all that simple. Furthermore, WSH's/VBScript's similarity to VB doesn't extend to having a good set of debugging tools.

Overdue for an Overhaul
Considering that Microsoft recently upgraded its development platforms by converting to the Windows .NET Framework and is planning a new release of Windows (code-named Longhorn), now is a great time for the company to introduce a new scripting technology. Ideally, the new environment would combine the ease of use and built-in functionality of command shell scripts with the power and flexibility of WSH/VBScript. Because Microsoft has shifted its development efforts to Microsoft .NET, it could base the new tool on the .NET Framework and incorporate some decent debugging capabilities.

Microsoft is rumored to be working on a .NET-based scripting environment code-named Monad. From what I've heard, however, Monad exceeds the scripting complexity of VBScript in the same way that Visual Basic .NET is more complex than VB. Above all, a new scripting tool should be simple enough that administrators can learn it as easily as they did command shell scripting. It shouldn't be a tool designed for programmers—Visual Studio .NET already fills that role nicely.

Scripting is a vital administrative activity. With a new version of Windows on the horizon, now is the time for Microsoft to overhaul Windows scripting.

End of Article



Reader Comments
<sigh> If only Windows had grep....

John Simonetti April 29, 2004


Mr. Otey:

First off, let me say that I agree with the basic idea of your article. I understand it to be that Admin.’s need a simple but powerful language to accomplish the tasks at hand as if Unix's shell scripts.

Nevertheless, I feel that you have not even visited the WSH 5.6 download area of Microsoft's website. I say this because there you will find some tools there ready to download and use that your article says there is none of. ( look at the last sentence of the first bolded topic - "A Tale of Two Technologies".)

I also agree that Microsoft seems to have a tendency to add-on to existing technology and thus making it more complex due to this patch work approach to enhancements ( short-term approach to fixes ). This approach seems to be the norm, but this approach needs to be changed with the Admin.’s needs in mind during creation of new products or technologies. I can tell you, from first hand experience that the Scripting Guys from Microsoft are Developers and they have a mindset of a developer when they teach. This is different from what is needed by a Network or System’s Admin. As you have pointed out. I understand that Monad will continue to build onto this scripting technology and that it will enhance what is already there.

Thank you for your article and what it is trying to bring to light.

Name withheld

Harvey Rothenberg April 30, 2004


Good idea, but rather than make a more complex scripting system, take a hint from the UNIX approach.
I started scripting in UNIX at a time when PCs were at best connected to a mainframe as a terminal. I have continued to use these concepts and ideas since then.
We currently use UNIX-like utilities and functions within Windows to get many of the jobs done quicker and accurately. The big difference I see is in the trend to making everything more complex rather than usable. Another problem is consistency. I have been told more than a few times about how problems exist in VBS and Windows because action is not the same at different locations, on different hardware, or against different software. It's one thing to have to write a different script for Oracle vs. SQL Server, but another for different patch levels of the same OS.
Perl is also another work horse in our shop.
I would really like to see a toolbox approach (remember KISS) with an already defined scripting language (e.g., perl or python), rather than something completely new (as Microsoft is likely to do).

Gordon G. Start May 03, 2004


As an avid windows shell scripter myself I've got to agree 110%!! WHile WSH/WMI/VB Script can indeed be much more powerful than the command shell (especially without using support tools and resource kit tools) it is certainly much easier and much quicker to get many tasks done. I've always wanted to learn VB Script/WSH/WMI but I'm always needing to write quick scripts to get a basic task done NOW and I can always do it much more quickly with shell scripting and the script is usually MUCH smaller to get the same end result. I think that Microsoft has actually been heading in the right direction with Windows XP and Windows 2003 because they have been includin more and more of the utilities which you either needed to install (Support Tools) or purchase (Resource Kit) right in the standard OS build. Think of REG.EXE; SHUTDOWN.EXE; NETSH.EXE; REGINI.EXE; etc. - these are now standard. I stand more on the Microsoft side of the fence than the Unix/Linus side of the fence, but I have always greatly appreciated the Unix way of scripting - using a toolkit of small useful tools which can be combined if necessary to get the job done - (AWK; SED; FIND; GREP; etc). Microsoft needs more high quality, easy to use, text manipulation utilities.

Just give me a FOR loop; an input text file; findstr; find; IF; and a few other internal and external commands and you'd be amazed at waht can be accomplished!

My 2 cents.

Robert Strom

Robert Strom May 15, 2004


Any scripts to terminate a any process that take 40% of the CPU.
Thanks.

dashnor August 19, 2004 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 24, 2008

An often irreverent look at some of the week's other news, including a Vista Capable dismissal request, Zune price reductions, Morrow musings, Novell and Microsoft sitting in a tree ... two years later, Yahoo!, IE 6 on Windows Mobile, and so much more ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Check out our list of Free Email Newsletters!

Scripting eBooks Keeping Your Business Safe from Attack: Encryption and Certificate Services

Best Practices for Managing Linux and UNIX Servers

Building an Effective Reporting System

Related Scripting Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing