0% found this document useful (0 votes)
136 views2 pages

Using CScript.exe for Script Execution

CScript.exe allows running scripts from the command prompt. It uses the syntax "cscript [host options...] [script name] [script options and parameters]". Host options enable or disable Windows Script Host features and are preceded by two slashes. Script name specifies the script file. Script options and parameters are passed to the script and preceded by a single slash. CScript supports host options like //I for interactive mode and //B for batch mode. The //T parameter sets a time-out limit for script execution. The document provides an example of running the Chart.vbs sample script with and without logos using CScript.

Uploaded by

Basavaraju K R
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views2 pages

Using CScript.exe for Script Execution

CScript.exe allows running scripts from the command prompt. It uses the syntax "cscript [host options...] [script name] [script options and parameters]". Host options enable or disable Windows Script Host features and are preceded by two slashes. Script name specifies the script file. Script options and parameters are passed to the script and preceded by a single slash. CScript supports host options like //I for interactive mode and //B for batch mode. The //T parameter sets a time-out limit for script execution. The document provides an example of running the Chart.vbs sample script with and without logos using CScript.

Uploaded by

Basavaraju K R
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

3/20/2016

[Link]

ClickheretoshowtoolbarsoftheWebOnlineHelpSystem:showtoolbars

MicrosoftWindowsScriptHost

RunningScriptswith
[Link]

WSHTutorial
Previous
Next

[Link]
[Link]
[Link],typeacommandlineatthecommandpromptusingthefollowingsyntax:

cscript[hostoptions...][scriptname][scriptoptionsandparameters]
wherethetermsaredefinedasfollows:

[Link]
precededbytwoslashes(//).

Scriptnameisthenameofthescriptfile,completewithextensionandanynecessary
pathinformation,suchas:d:\admin\vbscripts\[Link].

[Link]
precededbyasingleslash(/).
Eachparameterisoptionalhowever,youcannotspecifyscriptoptionswithoutspecifyingascript
[Link],CScriptdisplaystheCScriptsyntaxandthevalidhost
[Link].
Parameter

Description

//I

Interactivemode:allowsdisplayofuserpromptsandscripterrors
(thisisthedefault,andtheoppositeof//B).

//B

Batchmode:suppressescommandlinedisplayofuserpromptsand
scripterrors.

//T:nn

Enablestimeout:themaximumnumberofsecondsthescriptcanrun.
Thedefaultisnolimit.(Seethetextfollowingthistableformore
informationonthisparameter.)

//logo

[Link](oppositeof//nologo).

//nologo

Preventsdisplayofanexecutionbanneratruntime.

//H:CScript [Link]
or
[Link],[Link]
//H:WScript default.
//S

Savesthecurrentcommandlineoptionsforthisuser.

//?

Showscommandusage(sameaswithparameters).

//E:engine

Executesthescriptwiththespecifiedscriptingengine.

//D

Turnsonthedebugger.

//X

Launchestheprograminthedebugger.

//Job:
<JobID>

[Link].

The//[Link],
CScriptinterruptsthescriptingengineusingtheIActiveScript::InterruptThreadmethodandterminatestheprocess.

ACScriptExample

SeveralsamplescriptsareinstalledwhenyouinstallthefinalreleaseoftheWindowsScriptHost.
Thesearealsoavailablefordownloadat:[Link]
Suppose,forthepurposesofthisexample,[Link]
computer:

[Link]

1/2

3/20/2016

[Link]
c:\samplescripts\[Link]
Youcanrunthescriptwithandwithoutalogo,asfollows:

[Link]
menu.
[Link](modifyaccordinglyifyoursample
scriptsarelocatedinadifferentfolder):

cscript//logoc:\"samplescripts"\[Link]
cscript//nologoc:\"samplescripts"\[Link]
Dewsoft

[Link]

2/2

You might also like