Command Line with .mox file

A .mox file, with MOX code in it, can be run from the command line while a Moxie.Build system is not otherwise already running.

Syntax

Moxie.exe Filename[ ?URLparams]

 

Overview

The code in the .mox file will be run as if it was a public method, with any optional URL Params placed into the Request query. The full "Moxie.exe" name must be used (not just "Moxie") and the filename must end in .mox. Any URL Params must start with the ?

In most use cases, the .mox file will be a single line of code that simply calls an existing Public Method already in the system, but there is no limit on what code the .mox file includes.

Procedures in a system that can be called when running and from the command line which may need to know which context they are running under, can make use of the Req.IsCmdMox Request query value, which is set to true when running a .mox file from the command line.

 

Example

Moxie.exe RunMeWithNoParams.mox
Moxie.exe RunMeWithParams.mox ?Param1=Abc&Param2=Def
d:
cd \work\www.example.com
.\Moxie.exe C:\Util\ProProc\MOX\Nightly.mox ?DoThing1=y&DoThing2=y