c-treeRTG for isCOBOL : Server Startup : Startup on Windows
Startup on Windows
In order to start the c-tree Server in foreground mode, launch ‘ctreesql.exe’. You can run it from the Windows Start menu: Start > Programs > c-treeRTG v3.0.0 > c-treeRTG Server
Unless the entry CONSOLE TOOL_TRAY is present in the ctsrvr.cfg file, the following panel will appear.
Also, a new icon will appear in the system tray.
From the View menu you can hide the Message Monitor or show the Function Monitor (list of all internal functions called from clients). From the Control menu you can shut down the server. The same result is obtained by clicking on its window close button.
The c-tree Server can also be started from a command prompt by running the faircom.exe file installed in the c-treeRTG "server" folder. It is the same executable file pointed by the link mentioned above. The faircom executable file supports command-line parameters allowing you to specify configuration options or a custom configuration file directly on the command-line; see The faircom executable command-line for details.
Windows Service
In order to start the c-tree Server in background mode, you must create a service.
If you didn’t create the service during the setup process, you can start an MS-DOS prompt with Administrator privileges and run:
sc create c-treeSQL start= auto binPath= "C:\Veryant\c-treeRTG v3.0.1\server\faircom.exe"
Note - "c-treeSQL" is just a suggested name, but any name can be used. The path to faircom.exe might be different on your machine.
After it, you can optionally assign a description to the service as follows:
sc description c-treeSQL "c-treeSQL Server"
If the above commands are successful, you will find this new service available in the Service Control Manager:
You can manage the c-treeSQL service from the Service Control Manager or by running other sc commands in the MS-DOS prompt.
For more information about the sc command, refer to Microsoft documentation: https://technet.microsoft.com/en-us/library/bb490995.aspx.
To remove the service from the system, use this command:
sc delete c-treeSQL
Starting multiple services on the same machine
In this example we show how to start two c-tree Server services listening on different ports on the same machine.
1. Create two configuration files, e.g.
ctsrvr1.cfg:
SERVER_NAME FAIRCOMS1
SERVER_PORT 6661
LOCAL_DIRECTORY ./data1/
ctsrvr2.cfg:
SERVER_NAME FAIRCOMS2
SERVER_PORT 6662
LOCAL_DIRECTORY ./data2/
Note - the two snippets above shows the basic configuration, they should be completed with the rest of settings that usually appear in a c-tree configuration. We notice that different ports and different data folders are referenced in the two configuration files.
2. Create the two services as follows:
sc create c-treeSQL-1 start= auto binPath= "C:\Veryant\c-treeRTG v3.0.0\server\faircom.exe CTSRVR_CFG \path\to\ctsrvr1.cfg"
 
sc create c-treeSQL-2 start= auto binPath= "C:\Veryant\c-treeRTG v3.0.0\server\faircom.exe CTSRVR_CFG \path\to\ctsrvr2.cfg"