Windows Scripting
  Home arrow Windows Scripting arrow Page 5 - More Alternative Languages for WSH
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

More Alternative Languages for WSH
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2008-08-18

    Table of Contents:
  • More Alternative Languages for WSH
  • Object Rexx
  • KixStart
  • Ruby
  • Tips and Other 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


    More Alternative Languages for WSH - Tips and Other Languages


    (Page 5 of 5 )

    In these last two articles, I’ve profiled what I would consider to be the most likely alternative languages for use in the Windows Script Host environment. This list is by no means comprehensive. There are dozens more WSH-enabled languages available for you to choose from. A Google search and a little research may reveal a version of your own favorite that is also WSH-enabled. Here’s a short list of some additional languages that I know of that offer WSH support.

    As you’ve seen throughout my samples, many of these languages require you to specify an interpreter engine on the command line in order to run your scripts in the WSH environment. The tip I’m about to show you will allow you to double-click a script file or run it directly from the command line as you can with .vbs and .js files now.

    You will have to modify the registry. As with any other registry changes, you should first create a backup in case something goes wrong.

    I’m going to create a .pys (PythonScript) file extension. To begin, you’ll need to open Notepad and copy the text below. You may also download my file here.

    Windows Registry Editor Version 5.00

     

    [HKEY_CLASSES_ROOT.pys]

    @="pysfile"

     

    [HKEY_CLASSES_ROOTpysfile]

     

    [HKEY_CLASSES_ROOTpysfileScriptEngine]

    @="Python"

     

    [HKEY_CLASSES_ROOTpysfileShellEx]

     

    [HKEY_CLASSES_ROOTpysfileShellExDropHandler]

    @="{60254CA5-953B-11CF-8C96-00AA00B8708C}"

     

    [HKEY_CLASSES_ROOTpysfileShellExPropertySheetHandlers]

     

    [HKEY_CLASSES_ROOTpysfileShellExPropertySheetHandlersWSHProps]

    @="{60254CA5-953B-11CF-8C96-00AA00B8708C}"

    The first point of interest is the file extension of the first line (.pys). This should be changed to reflect the file extension that you wish to use.

    The second point is the pysfile name. This can be changed to whatever you like.  It should typically reflect your file extension. Be sure to change every instance. It appears in nearly every line! (Try using the Replace… command on the Edit menu).

    Now change the value listed under ScriptEngine to reflect the proper script engine for your file type.

    Finally, save your file with a .reg extension. Now when you double-click it, your file should add the appropriate changes to the registry. Your file type is now associated with the Windows Script Host!

    The Windows Script Host provides a very flexible scripting environment. As you can see, it supports much more than just the VBScript that you are used to seeing. Don’t be afraid to take advantage of Python’s superb string handling or Perl’s regular expressions. Whatever your need or want, you now have the ability to use WSH in nearly any language you might choose. Until next time, keep coding!


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · WSH in not limited to Microsoft's VBScript or JScript languages. In fact, support...
     

    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 2 Hosted by Hostway
    Stay green...Green IT