Windows Script Host enables you to run scripts from the command prompt. CScript.exe provides command-line switches for setting script properties.
To run scripts using CScript.exe
cscript [host options...] [script name] [script options and parameters]
Host Options enable or disable various Windows Script Host features. Host options are preceded by two slashes (//).Script name is the name of the script file with extension and necessary path information, for example, d:\admin\vbscripts\chart.vbs
. Script options and parameters are passed to the script. Script parameters are preceded by a single slash (/).
Each parameter is optional; however, you cannot specify script options without specifying a script name. If you do not specify parameters, CScript displays the CScript syntax and the valid host parameters.
Several sample scripts, which are installed along with Windows Script Host, are also available for download at (http://msdn.microsoft.com/scripting).
Suppose, for the purposes of this example, that you have copied the Chart.vbs sample script to the following folder on your computer:
c:\sample scripts\chart.vbs
You can run the script with and without a logo as follows.
To run a script with or without a logo
cscript //logo c:\"sample scripts"\chart.vbs cscript //nologo c:\"sample scripts"\chart.VBScript
Running Scripts from Windows | What to Include to Run a Script | WScript.exe and CScript.exe Options