[ACCEPTED]-Where is mstest.exe located?-file-location

Accepted answer
Score: 91
for %x in (mstest.exe) do @echo.%~dp$PATH:x

from the Visual Studio Command Prompt is 1 your friend. For me it's in

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\
Score: 48

Type

where mstest.exe

into a Visual Studio Command Prompt...

0

Score: 11

Since Visual Studio 2012 (at least the express 3 versions) MsTest.exe is called vstest.console.exe and can 2 be found at

C:\Program Files (x86)\Microsoft 1 Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

Score: 10

I stumbled across this post because I'm 14 trying to automate some web tests.

You can 13 run >mstest /TestContainer:some.webtest 12 from the visual studio command prompt, sure 11 - but when you slap that in a batch file 10 the command prompt that's executed by default 9 doesn't have the visual studio tools included.

You 8 can search for mstest.exe, but that location 7 might not be the same across machine, so 6 it's unwise to hardcode in c:\

Rany Miller's 5 answer was god's send to me (thanks!) - he 4 suggested %VS90COMNTOOLS%\..\IDE\MSTest.exe

But that doesn't work if you 3 have VS 2010. Just replace the 90 with 100. My 2 batch file, that I can schedule as a task 1 to run nightly, looks like this:

SET SOURCEe=c:\myTestProjectFolder\
CD %SOURCE%
"%VS100COMNTOOLS%..\IDE\mstest.exe" /TestContainer:some.webtest
Score: 6

If you can't find it, try searching like 1 this:

%VS90COMNTOOLS%\..\IDE\MSTest.exe
Score: 3

My automated test scripts uses:

"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe"  

The full 1 command I use is:

"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe"  /testcontainer:[PathToTestDll] /resultsfile:[TrxOutputPath]
Score: 2

If you run a visual studio commmand prompt 7 before you run your scripts -- which should 6 be doable in most situations -- you can 5 run %VSINSTALLDIR\Common7\IDE\mstest -- this 4 means that you can move with the version 3 of VS, and not have to react to director 2 changes if users install in a different 1 directory.

Score: 1
"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE

0

Score: 0

C:\Program Files\Microsoft Visual Studio 6 9.0\Common7\IDE

If people only knew that 5 Windows can search for files...

You can simply 4 open up Visual Studio's command line prompt 3 to include that directory in the PATH. Take 2 a look at the start menu entry "Visual Studio 1 2008 Command Prompt".

More Related questions