MapForce Server Command Line
MapForce Server provides a command line interface that you can use for administrative tasks such as licensing, and also to run mapping execution files (.mfx). The available commands are listed below.
•assignlicense: (Windows only) Uploads a license to LicenseServer and assigns this license to MapForce Server.
•exportresourcestrings: Exports all application resource strings to an XML file.
•help: Displays information about the command that is submitted as argument (or about all commands if no argument is submitted).
•licenseserver: Registers MapForce Server with a LicenseServer on the local network.
•run: Runs a Mapping Execution File (.mfx) compiled with MapForce.
•setdeflang: Sets the default language of MapForce Server.
•verifylicense: (Windows only) Checks if current MapForce Server is licensed and, optionally, whether it is licensed with the given license key.
•version: Displays the version number of MapForce Server.
To call MapForce Server at the command line, you need to know the path of the executable as applicable to your operating system. By default, the MapForce Server executable is installed at the following path:
|Note:||If MapForce Server 32-bit is installed on Windows 64-bit, change C:\Program Files to C:\Program Files (x86).|
By convention, this documentation omits the full path of the executable when describing a given command, and uses mapforceserver instead of the executable name, for example:
Where mapforceserver is the path or name of the executable. Note that, if you use an absolute path, you will be able to run commands regardless of the current directory that your command prompt window (terminal) is in. However, if you would like to call the executable just by typing its name, make sure to do one of the following first:
•Change the terminal's current directory to the MapForce Server installation directory
•Add the directory where the executable is to the PATH environment variable.
Both of these scenarios are described in more detail below.
Tips and tricks
If you are new to command line, be aware of the following tips and tricks.
•To find out the current directory where you command line window is, enter pwd on Linux and macOS. On Windows, enter echo %CD%.
•Make use of the Tab key to quickly enter various file or directory paths without having to type them in full. For example, if you type cd c:\prog at the command line, and then press Tab, you will get C:\Program Files automatically pre-filled (or perhaps some other directory under C:\ whose name begins with "Prog").
•When entering paths that contain white space, such as C:\Program Files on Windows, enclose them within quotes.
•If you see a message similar to "This command is not recognized as an internal or external command, operable program or batch file", you have most likely mistyped a path or command.
•On Linux, make sure that you use the correct case for file or directory names. For example, typing a path such as /home/nikita/downloads will return an error if the directory name is actually /home/nikita/Downloads.
•When typing a path on Linux or macOS, use forward slashes, as opposed to back slashes on Windows.
How to run a command
1.Open a command prompt window.
a.To open a command prompt on Windows, press the Windows key and then start typing cmd. Click the Command Prompt suggestion that appears.
b.To open a terminal on Mac, click the Finder icon, and then select Go > Utilities from the menu. Double-click the Terminal icon in the Utilities window.
c.If you run Linux from a graphical user interface, locate and run the Terminal command as applicable to your Linux distribution. If you run Linux from a command line interface, ignore this step.
2.Enter the full path to the executable, followed by the command you want to run. For example, the command below provides help at the command line.
C:\Program Files (x86)\Altova\MapForceServer2022\bin\MapForceServer.exe help
In the example above, the command help was run without any options or arguments. Other commands may have arguments and options, and those arguments and options could be mandatory or optional. For example, the run command has a mandatory argument that lets you supply the path or file name of the .mfx file to be run. Check the reference section for details about each command.
Calling MapForce Server in the installation directory
To call the executable without having to type the full path, change the current directory to the directory where the MapForce Server executable was installed, for example:
cd "C:\Program Files (x86)\Altova\MapForceServer2022\bin\MapForceServer.exe"
You can now run any command by typing just the executable name, for example:
|Note:||On Linux and macOS systems, the prefix ./ indicates that the executable is in the current directory.|
Calling MapForce Server from any directory
To call the executable from any directory, refer to it using the absolute path. Alternatively, if you want to call the program by typing just the executable name, you can edit the PATH environment variable of your operating system so that it includes the full path to the MapForce Server installation directory. For ways to change the PATH environment variable, refer to the documentation of your operating system.
|Note:||After changing the PATH environment variable, you may need to close the terminal window and open a new one, in order for the changes to take effect.|