Skip to main content

Command-line usage

Below are the basic steps for running CgiRemoteControl.exe. Because CgiRemoteControl.exe only triggers plugin processing, a separate plugin implementation is required.

Execution Format

Run CgiRemoteControl.exe from a script or command prompt using the following format. See the next section for the runtime arguments.

CgiRemoteControl.exe --SolutionFilePath "<path>.scs" [--PlugInControl "<command>"] [<configFile>]

Arguments

Specifying the Solution Path (Required)

--SolutionFilePath <path>
Specifies the path to the .scs solution to load (relative or absolute path is acceptable).
Example:

--SolutionFilePath "C:/path/test.scs"

Specifying the Plugin Command (Optional)

--PlugInControl "<command>" 
Specifies the plugin command to execute during processing. If omitted, the plugin’s OnPluginControl implementation is not invoked.
Example:

--PlugInControl "BuildHost 4711"

Specifying the Configuration File (Optional)

<configFile> 
Specifies the XML configuration file name to use. If omitted, the default CgiRemoteControlConfig.xml is used.
Example:

C:/path/CgiRemoteControlConfig.xml

Checking Execution Logs

The console prints the selected configuration file name, resolved SCHostPath, SolutionFilePath, PlugInControl, TimeoutMilliseconds, and so on. When processing completes, a final message is printed. You can check the process exit code with echo %ERRORLEVEL%.

Exit Code

Return codes indicate success or failure (0 for success; non‑zero for failure).

Code Description
0 Success
-1 Configuration file not found
-2 Permission error accessing the configuration file
-3 Invalid configuration file format
-4 Error loading the solution
-5 SCHost not found 
-6 Process timed out
-7 Process cancelled
-8 General error

Code Execution Example

D:/work/bin/SceneComposer>CgiRemoteControl.exe --SolutionFilePath "C:/path/test.scs" --PlugInControl "BuildHost 4711"
[2025-01-17 10:42:05.954] [Info] Using configuration file: CgiRemoteControlConfig.xml
[2025-01-17 10:42:06.033] [Info] Resolved SCHostPath: C:/path/SCHost.dll
[2025-01-17 10:42:06.033] [Info] Loaded configuration:
[2025-01-17 10:42:06.033] [Info]   SCHostPath: C:/path/SCHost.dll
[2025-01-17 10:42:06.033] [Info]   SolutionFilePath: C:/path/test.scs
[2025-01-17 10:42:06.033] [Info]   PlugInControl: BuildHost 4711
[2025-01-17 10:42:06.033] [Info]   TimeoutMilliseconds: 1800000
[2025-01-17 10:42:06.033] [Info] CgiRemoteControl Process start.
Info: The following licenses were acquired successfully: 2D, 3D, Globalization, SmartImporter, AssetLibraryVerification, Safety.
0000000.574 [0x00009BC0] WARN  Controls      Failed to create source stream object. Possibly no VideoStreamer is registered. {VideoStreamBehavior.cpp(143): VideoStreamBehavior}
Info: Starting schema validation of file:
Info: 1/17/2025 10:42:15 AM:OnSolutionChanged
Warning: The application specification file is missing or invalid!
[2025-01-17 10:42:15.021] [Info] Solution loaded successfully.
Info: 1/17/2025 10:42:15 AM:test log start
Info: 1/17/2025 10:42:15 AM:OnPluginControl BuildHost 4711 Processing...10%
Info: 1/17/2025 10:42:16 AM:OnPluginControl BuildHost 4711 Processing...50%
Info: 1/17/2025 10:42:17 AM:OnPluginControl BuildHost 4711 Processing...100%
Info: 1/17/2025 10:42:17 AM:test log end
[2025-01-17 10:42:17.063] [Info] Plugin executed successfully.
[2025-01-17 10:42:17.063] [Info] CgiRemoteControl Process end.

>echo %ERRORLEVEL%
0