Hi,
Normally, using the VisualGDB.exe /runtests <container> command line would automatically program the memory, run the tests and save the results.
If you are not using the VisualGDB test frameworks, you can also use the VisualGDB.exe /launch <vgdbsettings file> syntax as an equivalent of the “run without debugging” command in Visual Studio.
Finally, Segger J-Link might have its own set of commands for scripting FLASH memory programming. Feel free to double-check their documentation, it may contain some relevant examples.