CS-Script 3.20.0


Command-line interface

This is the general pattern of usage command-line parameters with a CS-Script engine executable (eg. csc.exe): 

cscs.exe [<switch1>] [<switch2>] <file> [params] [//x]



Use one of the following command-line switches (switch1)

Command line switch  Description
/? or /help Display help info.
/e Compiles script into console application executable. 
/ew Compiles script into Windows application executable. 
/c Use compiled file (.compiled) if found (to improve performance). 
/ca Pre-compiles script file into assembly (.compiled). 
/cd Compiles script file into assembly (.dll). 
/s Prints content of sample script (eg. csc.exe /s > sample.cs).
/autoclass or /acAutomatically generates wrapper class if the script does not define any class.

 Note

If the script engine executable is launched with help  parameter it will be interpreted as a help.cs script file file and the CS-Script Help(CSScript.chm) will be opened.

Use any combination of the following command-line switches (switch2)

Command line switch  Description
/nl No logo mode: No banner will be shown at execution time.
/dbg or /d Forces compiler to include debug information.
/l 'Local' switch, which forces script to start in the same directory where it is.
/verbosePrints runtime information during the script execution (applicable for console clients only)
/v
Prints CS-Script version information
/noconfig[:<file>] Do not use default config file (css_config.xml) or use alternative one.
Example: cscs.exe /noconfig sample.cs; cscs.exe /noconfig:c:\cs-script\css_VB.xml sample.vb
/sconfig[:<file>] Use script config file or custom config file as a .NET application configuration file.
/r Forces the script engine to load explicitly referenced assembly
/dir Adds path(s) to the assembly probing directory list.  (eg. cscs.exe /r:C:\MyLibraries myScript.cs).
/co:<options>  Passes compiler options directy to the language compiler.
 (eg. /co:/d:TRACE pass /d:TRACE option to C# compiler).
/precompiler
Specifies custom precompiler file(s). This can be either script or assembly file (see Precompilers for details).

Note:


Executable aliases

CS-Script engine executable comes in two different forms:

cscs.exe - console application
csws.exe - windows application


In all command line examples throughout this document "cscs.exe" is referred as "cscs".

CS-Script engine launcher

For convenience you can use special the CS-Script engine launcher css.exe. If it is used from command prompt it acts exactly as cscs.exe. However, if it is executed not from command-prompt (eg. Start->Run), it hides the console application window thus it acts as csws.exe. Please note that if it happens that during the execution the script does some console output (eg. Console.WriteLine(...)), css.exe will detect it and will display the console window if it was hidden. 

CS-Script Help

If the script engine executable is launched with help parameter it will be interpreted as a help.cs script file file and the CS-Script Help fill be opened:

cscs help

See Also

CS-Script fundamentals | Integration with OS