Command Line Options

From SysCAD Documentation
Jump to navigation Jump to search

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


Introduction

The command line options can be used:

  • in a desktop shortcut for SysCAD (Target field)
  • to run SysCAD from the CMD or DOS prompt
  • to run SysCAD from within a batch (or cmd) file

Example to start SysCAD from command line prompt or shortcut:

C:\SysCAD138\bin\SysCAD93

If the DOS or CMD prompt is used often, the folder location of the SysCAD executable file can be added to the system search path to avoid having to give the full path every time SysCAD is called.

The SysCAD executable file is normally found in the folder:

SysCAD installed drive:\SysCAD138\bin (for SysCAD 9.3 build 138)
SysCAD installed drive:\SysCAD137\bin (for SysCAD 9.3 build 137)
SysCAD installed drive:\SysCAD93\bin (for SysCAD 9.3 build 136)

Passing options to an already open copy of SysCAD

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

If there are any command line options, then at startup SysCAD will look for the first instance of SysCAD running (that has the same major Build number) and pass the command line options to this and exit the instance started. This is the default action unless the /n command line option is included to start a new instance of SysCAD.

General Command Line Options

NOTE: The examples given below are common for all 9.3 builds. Where SysCADxxx is used below, please substitute in SysCAD138, SysCAD137 or SysCAD93 depending on the version of SysCAD used.

In general, an example of the command line with its different options is as follows:

SysCADxxx [/l] [/n] [/p] [*[.SPJ]] [*.SSC]

All options are optional as indicated by the square brackets. The options are case sensitive. They may be in any sequence. The different switches are explained as follows:

OPTIONS DESCRIPTION EXAMPLE / NOTE
/l Location of SysCAD license. For example, if SysCAD is installed on the network, the license is located on the server machine, use this to point to the SysCAD License Location.
/l:"f:\SysCADxxx\ProBal_License"
/l:"f:\SysCADxxx\Dynamic_License"
NOTE: Make sure the full path for the license folder is given. Path containing spaces or long file-names should be enclosed in quotes.
/n starts a new instance of SysCAD.
If SysCAD is already loaded and a command line is passed, the command is "sent" to the copy of SysCAD already loaded unless the /n option is specified.
When commands are sent to an already loaded copy of SysCAD, the only recognisable command is the script file command; all other options are ignored.
/rt runtime mode
Starts a new instance of SysCAD in runtime mode. This is equivalent to using a Runtime license.
/p prompt for reload of previous project.
This option can also be set on the General Tab of the General Options dialog box.
/nocloseprompt don't prompt for project save when closing
/[*.spj] loads the specified project.
If a filename with no extension is specified *.SPJ is assumed.
If a project file (*.SPJ) is found then it is loaded - any subsequent projects would be ignored. The "/p" option would also be ignored if specified.
NOTE: Make sure the full path for the project is given. Project path containing spaces or long file-names should be enclosed in quotes.
/[*.ssc] loads the specified script command file.
If any Command Scripts (*.SSC) are found then they are executed in the order they are specified on the command line. The "/p" option would be ignored if specified.
Note that if any of the command scripts use the Exit command, then all additional script commands and script files will NOT be executed.
NOTE: Make sure the full path for the script file is given. Path containing spaces or long file-names should be enclosed in quotes.

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 here 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:\SysCAD138\bin\SysCAD93 /RegCOMServer
/RegOPCServer Registers SysCAD as OPC server C:\SysCAD138\bin\SysCAD93 /RegOPCServer
/RegServer Registers SysCAD COM and OPC C:\SysCAD138\bin\SysCAD93 /RegServer
/UnregCOMServer UnRegisters the SysCAD COM Application object C:\SysCAD138\bin\SysCAD93 /UnRegCOMServer
/UnregOPCServer UnRegisters SysCAD as OPC server C:\SysCAD138\bin\SysCAD93 /UnRegOPCServer
/UnregServer UnRegisters SysCAD COM and OPC C:\SysCAD138\bin\SysCAD93 /UnRegServer

Examples

Cmd or DOS prompt examples

C:>\SysCAD138\bin\SysCAD93 /n /l:"c:\program files\SysCAD License"
C:>\SysCAD138\bin\SysCAD93 "C:\SysCAD138\Examples\40 Nickel\Demo Nickel Copper Project.spf"
C:>\SysCAD138\bin\SysCAD93 "C:\SysCAD138\Examples\02 Features\Command Script Example.spf\project.spj" "C:\SysCAD138\Examples\02 Features\Command Script Example.spf\CommandScript\UsingExcelReport.ssc"

The following commands must be ran under the administrative command mode:

C:>\SysCAD138\bin\SysCAD93 /RegCOMServer
C:>\SysCAD138\bin\SysCAD93 /RegOPCServer
C:>\SysCAD138\bin\SysCAD93 /RegServer
C:>\SysCAD138\bin\SysCAD93 /UnRegCOMServer
C:>\SysCAD138\bin\SysCAD93 /UnRegOPCServer
C:>\SysCAD138\bin\SysCAD93 /UnRegServer

Note: A VBA (Visual Basic Macro) can also be set up in MS Excel to Start and Run SysCAD and the command script files. See Starting and running SysCAD from MS Excel.