Command Line Parameters

WEAP accepts a number of command line parameters ("switches") when it is launched.  They are mostly used for automation, scripting, unattended (scheduled) runs, and parallel calculations.  Several switches can be combined on a single command line (and in a Windows shortcut or a .bat file).

A switch begins with a slash (/) and is not case sensitive.  Some switches take a value after a colon (:); if the value contains spaces, enclose it in double quotes.  For example:

"C:\Program Files (x86)\WEAP\weap.exe" /Worker /NetworkJobChannel:"\\server\share\WEAP_Jobs"

Opening areas and files

<area>.weap Open (restore) the named WEAP area file.  This is also what happens automatically when you double-click a .weap file in Windows.  (Given as a file name, not as a /switch.)
<plugin>.weapplugin Install the named WEAP plugin.  (Also happens when you double-click a .weapplugin file.)
/OpenArea:<AreaName> Open the named area on startup, e.g. /OpenArea:"Weaping River Basin"
/OpenArea:Ask Ask which area to open on startup.  (When you use /AllowMany to open a second copy of WEAP, it asks automatically.)

Multiple instances and parallel calculation

See Parallel Calculations for how these switches are used together.

/AllowMany Allow more than one copy of WEAP (or more than one worker) to run on the same computer at the same time.
/Worker Start as a "freelance" worker: open WEAP without an area and wait for a manager elsewhere to send it scenarios to calculate.
/Worker:N Start N workers at once from a single launch (this one plus N-1 more), e.g., /Worker:4 will open 4 workers.  Implies /AllowMany.
/Worker:Max Start one worker for each CPU core.  Implies /AllowMany.
/Worker:Ask Ask how many workers to start.  Implies /AllowMany.
/NetworkJobChannel:"<path>" Tell a worker which shared folder to watch for jobs, e.g. /NetworkJobChannel:"\\server\share\WEAP_Jobs"  The path can be a UNC path or a mapped network drive.
/NetworkJobChannel With no path given, the worker watches the network folder previously entered or used on this computer (saved in WEAP.ini).
/AzureJobChannel Tell a worker to watch the Azure storage container previously entered on this computer (saved in WEAP.ini) -- the account details never need to be typed on a command line.
/JobChannel:"<channel>" The classic general form.  Either a full channel description, e.g. /JobChannel:"Network|\\server\share\WEAP_Jobs", or just a channel type name (/JobChannel:Network, /JobChannel:Azure) to use the channel of that type previously saved in WEAP.ini.
/MoveWindow:<where> Position the WEAP window.  Three forms: a named position (Left, Right, Top, Bottom, TopLeft, TopRight, BottomLeft, BottomRight); exact coordinates as four numbers L,T,W,H (left, top, width, height in pixels, e.g. /MoveWindow:0,0,800,600); or n/N to tile the window as the nth of N workers in a grid, e.g. /MoveWindow:2/4 puts this window in the second cell of a 2x2 grid.  (Not needed with /Worker:N, which tiles its workers automatically.)

Scripting and automation

/Call:<script> Run the named script on startup, e.g. /Call:MyScript.vbs
/CalcScenario:"<list>" Calculate the listed scenarios, in the order given, then close, e.g. /CalcScenario:"Reference,Demand Measures"
/Verbose:<0-4> Set how much information WEAP reports and how it handles questions and errors, from 0 (silent -- do not stop for questions or errors) to 4 (most detailed).
/InstanceName:<name> Give this instance a name.  Its debug log lines are prefixed with the name and written to a separate file, Debug-<name>.txt (instead of the shared Debug.txt), so several copies of WEAP running at once do not overwrite each other's logs.  For a parallel-calculation worker, the name is also how the worker introduces itself in the manager's worker list.
/TerminateAfter:<minutes> Automatically close WEAP after the given number of minutes.  A safeguard for scripts and scheduled tasks, in case WEAP gets stuck and does not close on its own.
/LogFile:<filename> Set the error-log file name (equivalent to the WEAP.LogFile scripting command).