It has been reported in various places that MW2 missions can be started directly from the command line (1, 2, 3). These codes can be found by creating a fake MW2.exe file which prints or logs call parameters instead of or in addition to calling the actual MW2.exe. This still leaves some questions unanswered:
How does the shell tell the sim which mechs the user wishes to use? Userstar.bwd?
How does MW2 report the mission outcome back to the shell?
All Windows editions use DLL's rather than .exe's. Is it possible to create wrapper DLL's using Köntzä's project on Sourceforge?
MechWarrior 2
Here are the calling parameters for the Clan Jade Falcon missions:
Visual Studio contains a nice tool for obtaining info on DLL's: dumpbin. Here's what it says about exports from mw2.dll:
1 0 0000CC70 SimMain
2 1 0000D95D SimWindowProc
It says pretty much the same for all Windows versions of MW2.DLL respectively MercsW.DLL. SimMain should be the entry point for the sim, and the event handler SimWindowProc is also exported. This raises the question of whether to call SimMain or to create a window that uses SimWindowProc. The names are not decorated, meaning that they don't give any clues about their calling parameters. Too bad.
Userstar.bwd defines the user's star/lance when launching into combat. It contains a GPS tag for each mech on the lance/star. See this thread for details on the GPS tag.
(Cleaned Up Thread by Sir MMPD Radick, with later edits by Skyfaller)
The name for the BWD file defining the mech, at offset 25h rel. to GPS,
The name of the mech config, either as a reference into MW2.PRJ or the MEK subdirectory, at offset 2Dh rel. to GPS
The pilot's name at offset 36h,
Some number at 8.
That mystery number at 8h is probably the one that defines the mechwarrior's rank, at least one of them does. I played the first GBL mission as a Galaxy Commander!