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