locked
Run mstest cmd line through VB script RRS feed

  • Question

  • Hi 

    If i put the below in visual studio command line it works perfectly

    MSTest.exe /testmetadata:"C:\Users\drm111\Documents\QualityAssurance\QualityAssurance.vsmdi" /resultsfile:c:\temp\myresults.trx

    But I don't know how to call it using a VB script.

    Basically i want to call the cmd line and run the vsmdi but i want to do it through VB.net code.

    so the flow will be VB.net --> cmd line --> which runs mstest.exe with my arguements

    Any help will be highly appreciated 

    Thanks in advance


    drm1981


    • Edited by drm1981 Wednesday, March 14, 2012 10:50 PM
    Wednesday, March 14, 2012 10:50 PM

Answers

  • Hi, see http://www.dotnetperls.com/process-start-vbnet

    Thanks,

    Anuj


    http://www.anujchaudhary.com

    • Marked as answer by drm1981 Friday, March 16, 2012 8:10 PM
    Thursday, March 15, 2012 2:18 AM
  •     Dim msTest As New ProcessStartInfo()
        msTest.FileName = "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe"
        msTest.Arguments = "/testmetadata:""C:\Users\xxxx\Documents\QualityAssurance\QualityAssurance.vsmdi""" & " /resultsfile:c:\temp\xxxxxxx" & DateTime.Now.ToFileTime & ".trx"
        Process.Start(msTest)

    drm1981

    • Marked as answer by drm1981 Friday, March 16, 2012 8:09 PM
    Friday, March 16, 2012 8:09 PM

All replies

  • Hi, see http://www.dotnetperls.com/process-start-vbnet

    Thanks,

    Anuj


    http://www.anujchaudhary.com

    • Marked as answer by drm1981 Friday, March 16, 2012 8:10 PM
    Thursday, March 15, 2012 2:18 AM
  • Hi drm1981,

    Thank you for posting in the MSDN forum.

    Sub Main()

            Dimp AsNewProcess

            p.StartInfo.FileName = "cmd.exe"

            p.StartInfo.Arguments = "/k ""C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86"

            p.Start()

        EndSub

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Friday, March 16, 2012 7:36 AM
  • @Jack thanks for your answer , but my final goal is to run MSTest.exe the steps you have mentioned only lead up to changing cmd prompt to visual studio cmd prompt.

    drm1981


    • Edited by drm1981 Friday, March 16, 2012 6:18 PM
    Friday, March 16, 2012 6:12 PM
  •     Dim msTest As New ProcessStartInfo()
        msTest.FileName = "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe"
        msTest.Arguments = "/testmetadata:""C:\Users\xxxx\Documents\QualityAssurance\QualityAssurance.vsmdi""" & " /resultsfile:c:\temp\xxxxxxx" & DateTime.Now.ToFileTime & ".trx"
        Process.Start(msTest)

    drm1981

    • Marked as answer by drm1981 Friday, March 16, 2012 8:09 PM
    Friday, March 16, 2012 8:09 PM