You can also start Forge from the command line. This allows you to launch Forge programmatically, from other applications. You can start the application from code in different ways:
- Directly, via the main executable
First, you need to determine the installation folder that contains the main executable
Forge.exe. Unfortunately, the ClickOnce installer deploys the application to a personalized AppData subfolder that is hard to find. The Forge Options menu provides a command Open application folder that helps you find the location of the ClickOnce installation folder that contains the main executable.
- Indirectly, via the start menu shortcut
You can also launch the start menu
.appref-msshortcut created by the ClickOnce installer from code. The start menu shortcut is always created in a fixed location with the following path:%APPDATA%\Microsoft\Windows\Start Menu\Programs\Firely\Firely FHIR Tools\Forge for HL7 FHIR STU3.appref-ms
Alternatively, you can create or generate an
.appref-msshortcut in a well-known location. The shortcut is a single-line text file with the following contents:http://downloads.simplifier.net/forge/stu3/Forge.application#Forge.application, Culture=neutral, PublicKeyToken=d35f0fdbb3d5e195, processorArchitecture=msil
Command line arguments¶
The main Forge executable accepts command line arguments. You can specify one or more documents to open:
Forge.exe [filePath] [filePath] [...]
The specified arguments must be fully qualified absolute file paths. After startup, Forge will try to load all the specified files, if they exist.
If you launch Forge indirectly via the
.appref-ms shortcut, then you can also specify a single (!) command line argument.
"%APPDATA%\Microsoft\Windows\Start Menu\Programs\Firely\Firely FHIR Tools\Forge for HL7 FHIR STU3.appref-ms" "C:\Profiles\MyPatient.xml"
Unlike the main executable, the
.appref-ms shortcut does not accept multiple command line arguments. This is a limitation of the ClickOnce installer technology.