Windows Scripting
  Home arrow Windows Scripting arrow Page 3 - Overview Of The New Windows Scripting Host...
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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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

Overview Of The New Windows Scripting Host 5.6
By: Norbert Cartagena
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 21
    2003-09-22

    Table of Contents:
  • Overview Of The New Windows Scripting Host 5.6
  • Are You Ready?
  • Heeeeeeeere's Your Host.
  • New Contestants, Come On Down!
  • Let's Get This Show On The Road
  • Example Scripts
  • Roll The Credits

  • 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


    Overview Of The New Windows Scripting Host 5.6 - Heeeeeeeere's Your Host.


    (Page 3 of 7 )

    So now that you're well versed in what a script is (if you weren't to begin with), you probably want to know what a script host is. In short, a script host is a program that provides an environment in which users can execute scripts. If you're reading this, there's a 99.99% chance that you've used a script host before. For you *nix folks, shell programs such as C shell, Bash, and Korn shell are script hosts that use an object model that enable you to manipulate a file system. The DOS prompt can be thought of as a scripting environment because it can run scripts written in the "batch file" language. Heck, if you're reading this while using a browser that can execute scripts that use the Dynamic HTML object model, then you're using a script host right now!

    That being said, the Windows Script Host (WSH) is what allows you to run scripts in the Windows platform by creating an environment for hosting scripts. It's a general purpose scripting environment that can run scripts in a variety of languages that use a variety of object models to perform specific tasks. That's because it imposes no restrictions on either the language used to write the script or the object model used by the scripts. In fact, it's a bit like the whole .NET thing, exercising the philosophy of many languages, one platform. Here's an overview of how it works:

    When you run a script that you or someone else has written, the WSH will call the correct script engine in order to perform the given task(s), depending on what kind of script you wrote (whether it be JScript, VBScript, or with special preparation Perl, Python, REXX, among others). Now, it doesn't matter whether you double click on the script, run it from the command line, call it from another script, or it comes to you over a network; The WSH still comes up and runs it, provided it meets certain criteria.

    If you're like me, you're probably thinking, "Hey, wait a minute? What about security? What do you mean it just 'runs it'?" Well, with the latest version of WSH, there's an improved security model which addresses some of those concerns. This is why you should make sure that you're running the latest release of WSH. You can go to the Microsoft website and download the latest version (5.6, as of this writing). If you're running Windows XP or 2003, don't worry - you're already up to date. For more information on the security improvements, loving in the wrong kind of way, and ugly babies, check out the MSDN scripting website. Note that all the information in this tutorial pertains to this latest version.

    Ok, so you're running the latest version of WSH. Now you're ready to run scripts written in VBScript, JScript, or your favorite scripting language. All you have to do is double-click on any file that has the .js, .vbs or .wsf extension and that file will be executed within the WSH environment. Of course, you can also open up a DOS prompt to the right directory and run it from there. I don't recommend doing this with every .vbs, .js, or even .wsf file you can find, however. Not unless you want a virus infestation on your system bad enough to annoy Robin Miller. You'll want to make sure that your anti-virus definitions are up to date and that you scan every file that you didn't write. After testing your scripts thoroughly, you can even use the Windows Task Scheduler to schedule when to run them. For example, you can have Windows run WSH and the script automatically whenever Windows starts up or when you want to make sure you don't miss Futurama re-runs.

    More Windows Scripting Articles
    More By Norbert Cartagena


     

    WINDOWS SCRIPTING ARTICLES

    - Introducing Two-Way Data Binding using Silve...
    - Silverlight 2.0 Application Development with...
    - Burning Multisession CDs with IMAPI2 in WSH
    - Creating a Silverlight 2.0 Application that ...
    - Burning CDs with the IMAPI2 Control
    - Burning CDs in Windows XP with WSH
    - Advanced Word Object Scripting
    - Reading and Printing Word Documents in WSH
    - Scripting Microsoft Word
    - Using WSH to Catalog MP3 Files
    - Reading MP3 ID3 Tags in WSH
    - A Brief Look at Menus in WPF
    - More Examples of Simplified Image Processing...
    - Completing a WPF To-Do List Application
    - Simplified Image Processing in GDI+





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT