The Windows Script Host offers two possible environments for running a script:
The "cscript.exe" variant is recommended for automated scripts because program execution continues even in case of a warning message or error.
A script can be started by explicitly specifying the script engine to use followed by the name of the script file to run, as in:
C:\Documents and Settings\Andreas\Scripts>cscript MyJob.wsf
A shorter command line can be created by just using the name of your script as a command, as in:
C:\Documents and Settings\Andreas\Scripts>MyJob.wsf
Or by omitting the file name extension:
C:\Documents and Settings\Andreas\Scripts>MyJob
However, this command will start the default script engine which is normally "wscript.exe." You can define the default script engine by entering the following command in once:
C:\Documents and Settings\Andreas\Scripts>cscript //h:cscript
This will create the following output:
(R) Windows Script Host Version 5.6
Now you can start your script just by entering its file name, and it will be executed with "cscript.exe."