Windows Scripting
  Home arrow Windows Scripting arrow Page 2 - Getting Started With WSH 5.6
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

Getting Started With WSH 5.6
By: Norbert Cartagena
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 15
    2003-09-03

    Table of Contents:
  • Getting Started With WSH 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


    Getting Started With WSH 5.6 - Are you Ready?


    (Page 2 of 7 )

    Ok, before we start, I'll presume that you know and understand what a script is. If you do, then skip to the next section. If you don't, then keep reading.

    A script is a set of instructions. The computer executes the instructions, then returns some sort of value: a number, string, list, or another data type. As far as the WSH goes, it might look something like this:

     <? XML version="1.0" ? >
    <!-- 
    FilenameHello.wsf-->
    <
    job>
    <
    script language="VBScript">
    WScript.Echo "Hello, from you VBScript friends! Please press OK."
    </script>
    <script language="JScript">
    WScript.Echo ("Hey, this is JScript. Can you click OK again? I can't quite reach it.") ;
    </script>
    </job>

    I say "might" because WSH is really a language-independent, object-model independent tool. At first, most of the stuff you'll be looking at will probably look like this:

    'This will tell you the Username, Domain, and Computer Name
    Set WshNetwork = Wscript.CreateObject("Wscript.Network")
    Wscript.echo WshNetwork.Username
    Wscript.echo WshNetwork.UserDomain
    Wscript.echo WshNetwork.ComputerName

    Just a tad different, wouldn't you agree?

    If you're sure that you have at least WSH 2.0 installed, then go ahead and copy and paste these into Notepad, saving them as example1.wsh and example2.vbs (respectively). Double click on them and see how they work. If you're not totally sure that you have at least version 2.0 installed, keep reading before you do anything else. Don't worry about whether you know those commands mean right now. By the time you finish this you'll know at least what they're doing and how. All you should care about right now is that you know what a script is. Hazzah!

    More Windows Scripting Articles
    More By Norbert Cartagena


     

    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 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek