I know that it's late, anyway, it can serve others.
You can delegate this work to MSTest, you can make .bat or create a console application that does the following:
set MSTestEXE=%PROGRAMFILES%\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe "%MSTestEXE%" /testcontainer:CodedUITest\bin\Debug\CodedUITest.dll
CodedUITest.dll is the DLL that generates Visual Studio.
MsTest will run all the tests showing the results in CMD, and even create the TestResult.trx file.
source share