Windows Scripting
  Home arrow Windows Scripting arrow WSH in Other Languages
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

WSH in Other Languages
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2008-08-11

    Table of Contents:
  • WSH in Other Languages
  • VBScript
  • Jscript
  • Python
  • More Languages

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    WSH in Other Languages


    (Page 1 of 5 )

    Much of the appeal of WSH lies in its simplicity. However, much of its power lies in its flexibility. Most often you will see WSH scripts written in VBScript, but in reality the Windows Script Host supports almost any COM-enabled scripting language.

    Today we’re going to take a look at using WSH in other languages. WSH has built-in support for VBScript and JScript. These languages can be used out-of-box. In order to use other languages you must install a WSH-compatible engine for the language. This is also sometimes called an interpreter.

    Many scripting languages have WSH-compatible engines available. When executing a script, the Windows Script Host determines which engine to use based on the script’s file extension. If the script uses a registered file extension, WSH is often able to determine this automatically.

    Be aware that common file extensions may be associated with the original language runtime and not with the Windows Script Host. If not, you can specify what engine to use on the command line.

    cscript /engine:PerlScript myscript.pl

    Executing a script with a .pl file extension will execute it in the PerlScript runtime environment. The command line above will instead execute it within the WSH environment.

    You might consider creating a file association for specific file extensions to be used with WSH. For example, you might use .pls for PerlScript files that you intend to run in WSH. This will avoid possible confusion and allow you to run your scripts without the additional command-line parameter.

    This article is by no means comprehensive. I’m going to profile some of the more common languages that readers may want to use and provide a basic introduction that should get you up and running in the WSH environment. It would be impossible to teach every one of these languages within this article.  Instead, I’m going to assume that readers have some exposure to the language and demonstrate how to use the WSH-compatible components.

    More Windows Scripting Articles
    More By Nilpo


       · The Windows Script Host is not limited to VBScript and JScript. In fact, you can...
     

    WINDOWS SCRIPTING ARTICLES

    - More Windows Scripting Workarounds from Nilpo
    - Overloading Methods and More in VBScript
    - Improving MFC for Windows Vista
    - Regular Expressions in VBScript
    - Working with Dates in WMI
    - Completing Calendars with VBScript Date Func...
    - Building Calendars with VBScript Date Functi...
    - Working With Dates and Times in VBScript
    - Designing WCF DataContract Classes Using the...
    - Understanding Dates and Times in VBScript
    - Working With Arrays in VBScript
    - Compressed Folders in WSH
    - Using .NET Interops in VBScript
    - Nilpo`s Scripting Secrets, Vol I
    - Database operations using Silverlight 2.0 WC...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek