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)

    There are many examples of women that have excelled in learning, and even in war, but this is no reason we should bring ‘em all up to Latin and Greek or else military discipline, instead of needle-work and housewifry.
    Bernard Mandeville (1670–1733)

    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)