Launching test runs from TCM.Exe

First skim this article: msdn.microsoft.com/en-us/library/dd465192.aspx

Next, run this script to dump most of the data you need from TFS. You will still need to get some settings from MTM. The last line of output will show you what you need to fill in.

@echo off

if [%1] EQU [] (
Echo Must provide name of project as first parameter
exit /b 1
)

if [%2] EQU [] (
Echo Must provide name of collections as second parameter
exit /b 1
)

set myProject=%~1
set myCollection=%~2

echo Test Configs
tcm configs /list /collection:%myCollection% /teamproject:%myProject%
echo.

echo Test Plans
tcm plans /list /collection:%myCollection% /teamproject:%myProject% > testplan.tmp
type testplan.tmp
echo.

for /f %%i in ('type testplan.tmp') do @if %%i GTR 1 (
if %%i NEQ Id (
set mySuite=%%i
call :getSuite
)
)

tcm testenvironments /list /collection:%myCollection% /teamproject:%myProject%

exit /B 0

:getSuite
echo suites in plan %mySuite%
tcm suites /list /planid:%mySuite% /collection:%myCollection% /teamproject:%myProject%
echo.

echo tcm run /create /title:"[arbitrary name]" /planid:[id] /suiteid:[id] /configid:[id]

/settingsname:"[name from MTM]" /testenvironment:"[name from MTM]"

/collection:vstfbingmobile:8080/tfs /teamproject:[project]