Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


January 01, 1999

Using ActiveX Objects to Extend WSH's Functionality


RSS
View this exclusive article with VIP access -- click here to join |
See More VBScript Articles Here | Reprints | Or sign up for our VIP Monthly Pass!
SideBar    The Pros and Cons of Perl and VBScript

Conventional wisdom holds that the Windows Scripting Host (WSH) provides the graphical equivalent of the humble DOS batch file. Although this assertion has an element of truth, looking at WSH as a mere batch file replacement sells it short. WSH scripts can easily read and write to files--tasks that your garden-variety batch files can't handle. You just have to know how to use ActiveX objects to bring additional functionality into the WSH environment.

As Michael Otey pointed out in "An Introduction to WSH" (December 1998), WSH is a script processor that can support multiple scripting languages. WSH natively supports Visual Basic Script (VBScript) and JScript, but it can also support just about any other scripting environment, provided a clever programmer has written a processing engine and made the proper file associations. Programmers have already accomplished these tasks for the Perl and Python script languages.

Deciding which language to use depends on personal preference. (For more information about two commonly used scripting languages, see the sidebar "The Pros and Cons of Perl and VBScript," page 2.) In this article, I'm using VBScript, because Windows power users and developers often use it. More important, you can easily push VBScript beyond your usual expectations by using ActiveX objects to create simple applications. Built on the Component Object Model (COM), ActiveX is a technology that lets software components interact with one another, no matter what language the software developers used. In other words, ActiveX provides language-neutral objects that you can use with any scripting language. In this article, I'll show you how to use an ActiveX object to create a basic revision control system. After I explain how this application operates, I'll describe how the ActiveX object works and how to use it in scripts. . . .


Already a VIP member?
Please log on to view the full article

Why become a VIP member?

VIP-only online access
VIP CD delivered twice a year: offline access to the entire Windows IT Pro article library
Monthly issue of your choice of Windows IT Pro or SQL Server Magazine

Subscribe Now
Reader Comments
<P>This is a nice document. But I am having problem. The problem is I want to write a .vbs file which will encrypt a file using aspencrypt object. I have installed an evaluation copy of the component in IIS. But when I am running the script, it is telling that ActiveX can not create that object. Could you suggest something?</P>

suman kalyan dey December 16, 2003


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Command Prompt Tricks

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

WinInfo Short Takes: Week of November 9, 2009

An often irreverent look at some of the week's other news, including some more Windows 7 sales momentum, some Sophos stupidity, Microsoft's cloud computing self-loathing, more whining from the browser makers, Zoho's "Fake Office," and much, much more ...

How can I stop and start services from the command line?

...


Scripting Whitepapers From Development to Production: Streamlining SharePoint Deployment with DocAve Deployment Manager

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!


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 DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement