Publication Command Line Arguments

Publications have support for some command line arguments: if you want to call your publication from your application and display a specific page for instance, or just run it using the Start|Run option of Windows.

The following command line switches are supported: page, mapid, setproxy, ignoreuserpos, and deactivate. But you can add your own switches too thanks to HEScript: see below.

Command line is especially useful with the “Only one instance of the publication” option (available in Security -> Global Protection). For instance:

  • if you launch your publication again with different command line arguments, the second and subsequent invocation of the EXE doesn’t start a new instance, but uses the one that’s already running and only changes the page displayed in it according to the command line.

  • if you create an HTML exe application myapp.exe, you can get myapp.exe to start with a certain page by using myapp.exe mapid 1024 where 1024 is the mapid for the page you want. If you then call myapp.exe mapid 1025 the first instance of the app will show the page with mapid 1025.



PUBFILE.EXE page [page to display]

Use this switch to specify the virtual path to the HTML page that should be displayed by the publication.


MYPUBFILE.EXE page comments.htm

PUBFILE.EXE page "my path  page1.htm"

When you have spaces, be sure to enclose the path in quotes (“”).



PUBFILE.EXE mapid [map ID of the page to display]

This switch can be used only if a map file is created. Specify the Map ID (integer) of the page you want to display.


MYPUBFILE.EXE mapid 1014



PUBFILE.EXE deactivate

Only recognized if you enable deactivation for a certificate which lets the end user uninstall his registration data.



PUBFILE.EXE setproxy

Lets the end user change his proxy server for activation, deactivation or validation.



PUBFILE.EXE ignoreuserpos

Normally, the end user can set size and move the publication window around. For greater comfort, the publication stores those parameters for the next time it is run. However, some users will move the window to a second monitor and, for the next running, will forget the window was on this second monitor (for instance, the latter is turned off…), so it will be considered as “lost” for them.

This command line option will open the publication screen-centered, ignoring the position previously saved. Thus, the window will be accessible.

add your own switches

If you work with HEScript, it is possible to read the parameters passed to the publication .exe file when the latter is run.

You can do this using the ParamStr internal function.

Copyright G.D.G. Software 2019. All rights reserved