The following constants are available for direct access in the script:
Name |
Meaning |
WScript.Name |
Contains name of the application |
WScript.Path |
Contains path to the application |
WScript.Version |
Contains internal version number |
WScript.FullName |
Contains full name of the application |
Example:
var MyFilePath= WScript.Path + "MyFile.txt";
WScript.Result = MyFilePath; // set the return value for a C# script
The variable WScript.Result is of special importance for a C# script, since it always serves as return value. In contrast to VBScript, for example, this return value is fixed and should be assigned at least once within the script. The last assignment defines the result.
In other script languages this variable is not defined and gives a syntax error when using it.