Command Line Options

From SysCAD Documentation
(Redirected from CommandLine)
Jump to navigation Jump to search

Navigation: User Guide ➔ Menu Commands ➔ Tools ➔ Command Scripts ➔ Command Line Options


Introduction

Command Line Options are additional flags which are added after the primary call of the command line which modify its execution. Command line options can be used:

  • in a desktop shortcut for SysCAD (appended to the Target field)
  • to run SysCAD from the command line (e.g. CMD, Command Prompt, DOS, Run, PowerShell, Terminal)
  • to run SysCAD from a batch (.bat) or command (.cmd) file

The SysCAD executable file is found in the bin folder. E.g. to start SysCAD from command line prompt or shortcut without any command line options (default install directory):

C:\SysCAD139\bin\SysCAD93.exe (note that ".exe" is usually optional)

If the command prompt is used often, the folder location of the SysCAD executable file can be added to the System PATH environment to avoid having to give the full path every time SysCAD is called.

Passing Options to an Open Copy of SysCAD

If there are no command line options, then a new regular instance of SysCAD is started.

If there are any command line options, then at start-up SysCAD will look for the first instance of SysCAD (with the same major Build number) which is already running and pass the command line options to that copy instead. This is primarily used for sending Command Script options to an open copy of SysCAD. All other command line options passed in this way are invalid or ignored. This is the default action unless the /n command line option is also included to start a new instance of SysCAD.

General Command Line Options

NOTE: The Command Line Options given below are common for all SysCAD 9.3 builds. Where SysCAD139 is used below, substitute with the appropriate path depending on the version of SysCAD used.

To call SysCAD with command line options:

C:\SysCAD139\bin\SysCAD93 [/n] [/rt] [/demo] [/l] [/p] [/nocloseprompt] [ProjectFolder] [*.ssc]

All command line options are optional as indicated by the square brackets (the square brackets are not typed), and may be in any sequence. The options are all case sensitive with the exception of file paths and extensions. File/folder paths containing spaces or long filenames must be enclosed in quotes.

OPTIONS DESCRIPTION EXAMPLE / NOTE
/n New instance of SysCAD

Starts a new instance of SysCAD.
NOTE: If other command line options are included, this option is required to open a new instance of SysCAD. See Passing Options to an Open Copy of SysCAD.

/rt Runtime mode

Starts a new instance of SysCAD in runtime mode, equivalent to using a Runtime License. This includes the "/n" option.

/demo Demonstration mode

Starts a new instance of SysCAD in (unlicensed) Demo Mode. This includes the "/n" option.

/l License location Sets the SysCAD License Location for this instance of SysCAD, temporarily overriding the setting in License > License Location (saved in BaseFilesUser\SysCAD.Machine.ini). Option must be followed by a colon and the license folder path, e.g.:
/n /l:"C:\SysCAD139\ProBal License"
/n /l:"C:\SysCAD139\Dynamic License"

Useful for managing multiple license locations for a single SysCAD install. See Managing Multiple License Locations.
This option is usually used together with the "/n" option as shown in above examples.
NOTE: Ensure the full path for the license folder is given. Paths containing spaces or long filenames must be enclosed in quotes.

/p Prompt load of previous project

On start-up, a dialog prompt automatically appears with the option to load the most recent previous project.
This option can also be set on the General tab of the General Options dialog box.

/nocloseprompt Supress save prompt on close Supresses the prompt for project save when closing SysCAD.
Useful for automation scripts. Use with caution!
[ProjectFolder] Load project

Loads the project from the specified Project Folder path (usually ending ".spf"). It is not necessary to include the Project File (/Project.spj) as this is assumed.
If a project is found and loaded, any subsequent load project command line options would be ignored. The "/p" option is also ignored if a project is specified.
NOTE: Ensure the full path for the project folder is given. Paths containing spaces or long filenames must be enclosed in quotes.

[*.ssc] Run command script

Executes the specified Command Script(s) (*.SSC) in the order they are entered on the command line. A project must be loaded (either via the script, or as a separate command line option).
If the "/n" option is NOT included, SysCAD will look for an already running copy of SysCAD and if found pass the command script to that copy for execution, and if another copy is not found it will run the command script on the copy just started.
If command scripts include the Exit() command, then any subsequent script commands and files will NOT be executed as SysCAD will have closed.
NOTE: Ensure the full path for the command script file is given, including the .ssc extension. Paths containing spaces or long filenames must be enclosed in quotes.

Examples

C:\SysCAD139\bin\SysCAD93 /n /l:"C:\Program Files\SysCAD License" Opens a new instance of SysCAD using the specified license
C:\SysCAD139\bin\SysCAD93 "C:\SysCAD139\Examples\40 Nickel\Demo Nickel Copper Project.spf" Opens SysCAD and loads the specified project (this will fail is SysCAD is already open)
C:\SysCAD139\bin\SysCAD93 "C:\SysCAD139\Examples\02 Features\Command Script Example.spf\project.spj" "C:\SysCAD139\Examples\02 Features\Command Script Example.spf\CommandScript\UsingExcelReport.ssc" Opens SysCAD, loads the specified project and runs the specified command script (this will fail is SysCAD is already open)

Note: A VBA (Visual Basic for Applications) Macro can also be set up in MS Excel to start SysCAD, load projects and run command script files. See Starting and Running SysCAD from MS Excel.

Registry Command Line Options

These commands can be used to register or unregister SysCAD Application COM Object and OPC Server. These commands are not case sensitive. Other copies of SysCAD should not be open when running these commands. User must be have administrative rights to run these commands. Please see Setting up SysCAD COM for instructions on how to run commands as an administrator. With these commands, an instance of SysCAD is not fully started and left open. If successful the registry is updated and no feedback is provided.

OPTIONS DESCRIPTION EXAMPLE / NOTE
/RegCOMServer Registers the SysCAD COM Application object C:\SysCAD139\bin\SysCAD93 /RegCOMServer
/RegOPCServer Registers SysCAD as OPC server C:\SysCAD139\bin\SysCAD93 /RegOPCServer
/RegServer Registers SysCAD COM and OPC C:\SysCAD139\bin\SysCAD93 /RegServer
/UnregCOMServer Unregisters the SysCAD COM Application object C:\SysCAD139\bin\SysCAD93 /UnRegCOMServer
/UnregOPCServer Unregisters SysCAD as OPC server C:\SysCAD139\bin\SysCAD93 /UnRegOPCServer
/UnregServer Unregisters SysCAD COM and OPC C:\SysCAD139\bin\SysCAD93 /UnRegServer