Using the mrScript Command Line Runner
1 Open a command prompt.
2 Type mrscriptcl followed by the path and name of the file that you want to run and the options that you require.
Syntax
mrScriptCL <filename>.<extension> [<options>]
Parameter
<filename>.<extension>
The path, name, and filename extension of the mrScript file that you want to run. If the path or filename contains spaces, enclose <filename>.<extension> in " " (double quotation marks).
You do not need to specify the path if the file is in the current folder.
Initializing options
To initialize some of the options, you can use an initialization file with the same name as the mrScript file and the .ini extension, for example: <filename>.<extension>.ini.
You can use this feature with the following options:
▪the metadata document (
.mdd) to use in the script: see
/m: <file>
▪the locales: both the input locale set with
/li: n, and the output locale set with
/lo: n.
In the .ini file, create a section like this:
[Options]
MDD=MyProject.mdd
TypeLib=MyTypeLib.dll
TypeLib=MyOtherTypeLid.dll
Locale=1049
Settings in the .ini file are overridden by the command line options.
Options
/?
Displays the syntax and options.
/a: <definition>[= <value>]
Similar to the /d option, except that the value, if assigned, is always treated as a string. Therefore, do not enclose the value in "\" and \"".
/d: <definition>[= <value>]
Specifies a definition that will be recognized by the
mrPrePro preprocessor. The
/d option is equivalent to including a
#define (see
#define and #undef) preprocessor directive in the mrScriptBasic script. You can assign a value to a definition in which case the preprocessor substitutes any occurrences of the definition in the script with the value.
If the value is a string, enclose it in "\" and \""; for example, "\"Hello world!\"".
To specify "\" immediately before \"", use a double "\". For example, "\"C:\LogFolder \\ \"".
You can specify more than one /d option when you run mrScriptCL. If the /u option is specified, any /d options are ignored.
Identifiers that occur within string literals (quoted strings) are not replaced.
/f
Initialize COM as free threaded.
/g
Make script-level variables visible to functions and sub procedures. The /g option is equivalent to including the Option GlobalVariables statement in the mrScriptBasic script.
/h
Used with the /v option, this option displays hidden variables.
/i:<file>
Specify a type library to load for the script (for enums).
You can also specify this option in an initialization file: see
Initializing options.
/l
Lists the registered parsers. In UNICOM Intelligence Data Model 2, there is only one registered parser, the mrScriptBasic parser.
/li: n
Set the input locale to n (which can be a hexadecimal or decimal value, such as 0x0406 or 1030).
You can also specify this option in an initialization file: see
Initializing options.
/lo: n
Set the output locale to n (which can be a hexadecimal or decimal value, such as 0x0409 or 1033).
You can also specify this option in an initialization file: see
Initializing options.
/loc:<location>
The package extraction destination. If a location is not specified, the default location (C:\Documents and Settings\<user_name>\Temp) is used to extract the .mrz or .dmz package and execute script.
/m: <file>
Specifies a metadata document (.mdd) file to use with the script. When you specify an MDM document (.mdd) file in this way, the MDM document is created as in intrinsic variable (called MDM) in the script. This means that you do not need to use the CreateObject function to create an instance of the MDM document in your script. The Document opens in read-only mode, so you need to call the Document.Open method only if you want to open it in another mode, such as read-write.
You can also specify this option in an initialization file: see
Initializing options.
/n
Used with the /o option, this option displays the opcodes only.
/o
Displays the opcodes generated by the script. When you run a script, it is represented as a compact intermediate code called p-code, which is processed into native machine code at run-time. Each opcode represents an individual step within the p-code representation. This option is typically used for debugging.
/p: <parser>
Parses the script using the specified parser. If you do not specify a parser, the default parser (mrScriptBasic) is used.
/r
Parses the script without executing it.
/s
Hides the “mrScript Command-line Utility” and copyright text.
/t
Displays the parse and execution timings.
/u
/v
Displays the variables generated by the script and shows their values when the script exits.
/x
See