Windows Programming Windows Software Host

 07 March 15:42   

    The DOS programming model, with its clumsy accumulation scripting capabilities was bound cutting out, and Microsoft bare to add an another scripting ambiance to Windows. The aftereffect of this was the Windows Software Host (WSH). WSH comes in two flavors: a animate approach adaptation (csh.exe) and a non-console adaptation (wsh.exe).

    WSH infact isnt a new language, but is instead an ambiance for programming in additional Alive scripting languages. Alive scripting languages are programming languages that are implemented as COM components. Any Alive scripting accent installed on your computer can be acclimated with WSH. By default, WSH can be programmed using JScript and VBScript, but additional Alive scripting languages can be installed and run in WSH. One of the added accepted 3rd affair Alive scripting languages is PerlScript, which is generally installed as allotment of the ActivePerl distribution.

    WSH scripts aswell cover a assertive bulk of XML code, that helps to ascendancy the ambiance of the active script. The accent getting acclimated to Software haveto be defined in an XML tag.

    WSH is an Item Aggressive environment, and WSH provided a ample amount of altar that the Alive scripting languages may tap into.

    Another Microsoft technology, Alive Server Pages (ASP) is a agnate program to WSH in that it is a language-neutral scripting ambiance that uses installed Alive scripting languages. However, ASP is acclimated as a server-side scripting apparatus for breeding webpages. WSH, in allegory is added able-bodied ill-fitted for use in scripting a bounded ambiance (although WSH can be acclimated as a server-side website scripting engine as well, if you dare!).

    A WSH Software book is a plain-text file, that may use a all-encompassing .wsh book extension. Also, some additional book extensions are associated with WSH, and may be added anecdotic then the simple .wsh extension. For instance, a WSH Software that is primarily VBScript may accept the addendum .vbs, and a WSH Software that is JScript may accept the addendum .js.

    Each WSH book haveto accept an XML JOB object. Anniversary Software may accept assorted Jobs, but anniversary job haveto accept an different ID. For instance, actuality are some sample job tags:

    

    

    

    Next, we haveto specify the scripting accent that we will be using to apparatus a specific job:

     tag. At the end of a job, we abutting with a
tag.

    WSH provides the WScript object, that has a amount of methods and fields for use in a WSH script. The WScript item never needs to be instantiated, and it is consistently accessible in any script. As an example, the Answer adjustment of the WScript item prints out a assertive string. The csh.exe (Console Version) of WSH will book the cord to the console, while the wsh.exe (Non-Console Adaptation will book the cord to a bulletin box. Actuality is a multi-lingual example:

    

    

    

    

    


    Note, of course, that you deceit use the PerlScript if you havent installed it on your computer.

    There are a amount of additional XML tags that can be acclimated in a WSH script.

    The tag contains a assertive bulk of apparent argument that describes the accepted file. For instance:

    

     This Software writes a cachet access to the log file, and updates the website.

    


    Now, this may assume like a difficult way to just address a comment, but the tag aswell has addition purpose. Lets say that we save the aloft cipher atom into a Software file, such as testdesc.wsh. Now, if we run our Software with the /? argument, we get the afterward result:

     C:>testdesc.wsh /?

     This Software writes a cachet access to the log file, and updates the website.

    When we forward the altercation /? to our script, all the argument that is accounting in the tag is printed to the console.

 


Tags: website, active, windows, server, language, programming, languages, installed, instance, environment, console, string, script, scripting, object

 script, scripting, active, languages, environment, windows, console, object, installed, language, programming, wscript, version, extension, instance, string, perlscript, certain, server, website, , active scripting, scripting languages, wsh script, wscript object, script the, script host, windows script, console version, active scripting languages, windows script host, wsh script that, programming windows script, non console version, windows programming windows,

Share Windows Programming Windows Software Host:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Permalink
Article In : Computers & Technology  -  Programming