title: How to run a script before running the debugger in Visual Studio 2019?
body: <p>I have a project in C++ in Visual Studio 2019 and I would like to run it in a conan virtualrunenv environment prepared using the Conan package manager. For this purpose, I would like to execute the script before running the debugger. I tried to do it by setting &quot;Command&quot; option in Properties&gt;Configuration Properties&gt;Debugging&gt;Command to value (cmd version):</p>
  <pre><code>D:\MyProject\bld\activate_run.bat &amp;&amp; $(TargetPath)
  </code></pre>
  <p>or (powershell version)</p>
  <pre><code>D:\MyProject\bld\activate_run.ps1; $(TargetPath)
  </code></pre>
  <p>but both executions ends with error &quot;Unable to start program . The filename, directory name, or volume label syntax is incorrect&quot;.</p>
  <p>In short: I would like to execute a script (.bat or .ps1) before executing the debugger.</p>
  <p>Does anyone know how this can be done?</p>