سؤال

Question Background:

I have produced a batch file that runs the .dll of my unit test project. Running this in the Visual Studio developers command prompt works perfectly. I now want to be able to run this batch file through the standard MS-DOS command prompt.

The issue:

this is the current batch file command:

cd C:\Users\Me\Desktop\WebService\CalcUnitTests

MSTest/testcontainer:C:\Users\Me\Desktop\WebService\Calc\CalcUnitTests\bin\Debug\CalcUnitTests.dll

Running the above batch file command on the MS-DOS NON-Developer prompt produces an error of:

'MSTest' is not recognized as an internal or external command, operable program or batch file.

How can I run the above batch file through the standard command prompt? Any info would be most helpful.

Edit:

I have now updated my Environment variables but still recieve the same unrecognized 'MSTest' error when running the batch file:

enter image description here

هل كانت مفيدة؟

المحلول

You will need to find the path to MSTest, which is dependent on the version of Visual Studio you have installed and then you need to add that path to your PATH Environment variables so that the MSTest command is available to any application, include the non-dev MS-DOS command prompt.

The path should look something like this:

"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe"  
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top