title: Create a Windows 10 desktop shortcut to run a python script in a venv virtual environment
body: <p>I am trying to create a clickable desktop shortcut for a Windows 10 system that simply executes the following commands that I currently need to repeatedly type in a Windows Powershell:</p>
  <pre><code>PS C:\Users\user&gt; cd C:\Users\username\Documents\PyProject
  PS C:\Users\username\Documents\PyProject&gt; .venv\scripts\activate
  (.venv) C:\Users\username\Documents\PyProject&gt; py -3 .\myscript.py
  </code></pre>
  <p>I've tried a few of the recommended solutions <a href="https://stackoverflow.com/questions/42602024/windows-shortcut-to-run-python-script-in-anaconda-command-prompt">here</a>, <a href="https://stackoverflow.com/questions/27332989/activating-a-python-virtual-environment-changing-directory-in-one-shortcut-wi">here</a>, and <a href="https://stackoverflow.com/questions/30927567/a-python-script-that-activates-the-virtualenv-and-then-runs-another-python-scrip">here</a> (including a few others not linked) but all fail by immediately closing the console/command window that is supposed to remain open and print out lines of text from the program.</p>
  <p>Some of my attempts have included:</p>
  <ul>
  <li>creating a <code>.bat</code> file that I saved in <code>...\PyProject\</code> with a shortcut on the desktop.</li>
  </ul>
  <pre><code>@echo off
  cmd /k &quot;cd /d C:\Users\username\Documents\PyProject\.venv\Scripts &amp; .\activate &amp; cd /d    C:\Users\username\Documents\PyProject &amp; py -3 myscript.py&quot;
  </code></pre>
  <ul>
  <li>using <code>pyinstaller</code> and <code>py2exe</code></li>
  </ul>
  <p>Any help would be appreciated. Thanks!</p>