X
Tech

The most programmable operating system ever

The popularity of Windows is due in very large part to programmability. From the very beginning, Microsoft has made it easy for people to write software to do what they want with Windows and its applications.
Written by Larry Seltzer, Contributor
The popularity of Windows is due in very large part to programmability. From the very beginning, Microsoft has made it easy for people to write software to do what they want with Windows and its applications. Windows 2000 is probably the most programmable software product ever, and by a long shot.

Of course, operating systems exist to be programmed, but Windows 2000 has some conspicuous differences: not only is almost every feature in the operating system programmable, but they are programmable through standard facilities. The two keys here are COM (Component Object Model) and Windows Script Host (WSH).

COM is a binary standard for program interoperability. Any two programs can call each other using COM and even discover what facilities exist to be called, as long as they follow a few simple rules. And since COM is built on simple programming constructs that almost any language can implement, it's language-independent. Visual Basic programs can call C++ or COBOL programs, and so on.

WSH is a scripting facility that lets you write system-level scripts in Windows. You can use many different scripting languages for WSH, including Microsoft's VBScript and JScript (Microsoft's JavaScript implementation), and Perl, TCL and others are available from third parties. Professional Windows network administrators, especially those at large corporations, love to write these scripts to automate their work. At one level, it's not terribly unlike the Perl and shell scripting that Unix administrators do, but the ease and uniformity in Windows makes a big difference.

Almost everything in Windows is scriptable using COM interfaces. If you want to create a user (and have appropriate rights) you can write a few lines of code for WSH to do it. You can write a script to take a list of names from an Access database or Excel spreadsheet and create accounts for them, because both those programs are also COM-scriptable. Windows 2000 supports a treasure-trove of APIs that let you program SMTP Server, Active Directory Services Interface and ActiveX Data Objects for database access through COM.

Scripting can make an administrator's life way easier, and the more systems and users you have to manage, the more valuable scripting skills are. If you want to learn more about Windows scripting, the launching point is Microsoft's scripting page at msdn.microsoft.com/scripting/.

Larry Seltzer is a freelance writer and software developer and the author of "ADMIN911:Windows 2000 Terminal Services." He can be reached at larry@larryseltzer.com.

Editorial standards