title: Running the Visual Studio Profiler from the command line
body: <p>As part of an automated profiling system, i want to run the visual studio profiler from the command line. </p>
  
  <p>According to all of the online documentation, i need to execute the following:</p>
  
  <pre><code>VSPerfCmd \start:sample /output:test.vsp /launch:Test.exe
  </code></pre>
  
  <p>VSPerfCmd is in my system path, and Test.exe is a HelloWorld C++ program compiled with VS2019 and located in the current directory. I am running the 32-bit version of the profiler and Test.exe is a 32-bit application. I get this error:</p>
  
  <pre><code>Error VSP1005: Command line error: Switch /launch:Test.exe is invalid. Aborting.
  </code></pre>
  
  <p>One of the guides in found mentioned running</p>
  
  <pre><code>VSPerfCLREnv /sampleon
  </code></pre>
  
  <p>before starting the profiler in sampling mode. However my version of the VSPerfCLREnv command does not recognize this parameter. Using the /Admin parameter for VSPerfCmd i installed and started the Profiler service, i am unable to start the kernel driver in the same way, but considering Test.exe is just a HelloWorld program, i don't think i would need it.</p>
  
  <p>Has anyone used the command line profiler in VS2019 and can share how they made it work?</p>