Windows Script Host - Examples

Examples

The first example is very simple; it shows some VBScript which uses the root WSH COM object "WScript" to display a message with an 'OK' button. Upon launching this script the CScript or WScript engine would be called and the runtime environment provided.

Content of a file hello0.vbs

WScript.Echo "Hello world" WScript.Quit

WSH programming can also use the JScript language.

Content of a file hello1.js

WSH.Echo("Hello world"); WSH.Quit;

Or, code can be mixed in one WSF file, such as VBScript and JScript, or any other:

Content of a file hello2.wsf

Read more about this topic:  Windows Script Host

Famous quotes containing the word examples:

    No rules exist, and examples are simply life-savers answering the appeals of rules making vain attempts to exist.
    André Breton (1896–1966)

    It is hardly to be believed how spiritual reflections when mixed with a little physics can hold people’s attention and give them a livelier idea of God than do the often ill-applied examples of his wrath.
    —G.C. (Georg Christoph)

    Histories are more full of examples of the fidelity of dogs than of friends.
    Alexander Pope (1688–1744)