title: Activate virtualenv and run .py script from .bat
body: <p>I'd like to use Windows Task Scheduler to run a python script within a virtual environment. I'd like the Scheduler to run a .bat file that will</p>
  
  <ol>
  <li>activate the virtualenv</li>
  <li>run the script</li>
  </ol>
  
  <p>These steps work together from the command line, and they work individually in a .bat, but I can't seem to get them to work together from the .bat. It seems the virtualenv is not fully activated when I try to execute the python script and confused as to why.</p>
  
  <p>My .bat looks like this:</p>
  
  <pre><code>call workon venv
  cd path/to/Python/proj
  python -m script.py
  </code></pre>
  
  <p>I've tried adding timeouts immediately after the call to <code>workon</code> and tried moving the <code>workon</code> to seperate .bat called from my first file, but the other lines still execute before the virtualenv is activated. Any help is greatly appreciated!</p>