title: Open .exe file through .bat file in Flask
body: <p>I am trying to open an .exe file (e.g. Paint) with a html button using Flask, so I wrote a small .bat file that runs it properly when I run it through Python, but does not seem to work when I open it through Flask.</p>
  
  <p>The Python is:</p>
  
  <pre><code>@app.route('/assemblies', methods=['GET', 'POST'])
  def assemblies():
      if request.method == 'POST':
          if request.form['submit'] == 'runFile':
              #os.startfile("/static/run.bat")
              text = "... running ..."
              filepath="/static/run.bat"
              p = subprocess.Popen(filepath, shell=True, stdout = subprocess.PIPE)
              stdout, stderr = p.communicate()
              return render_template('assemblies.html', text=text)
          else request.form['submit'] == 'process':
              [do other stuff]
      elif request.method == 'GET':
          return render_template('assemblies.html')
  </code></pre>
  
  <p>(Part of) the html file is:</p>
  
  <pre><code>&lt;div class="container"&gt;
      &lt;form action="/assemblies" method="post"&gt; ASSEMBLY &lt;br&gt; 
          &lt;select name="Layer"&gt;
              &lt;option value="1"&gt;1&lt;/option&gt;        
              &lt;option value="2"&gt;2&lt;/option&gt;
              &lt;option value="3"&gt;3&lt;/option&gt;
              &lt;option value="4"&gt;4&lt;/option&gt;
              &lt;option value="5"&gt;5&lt;/option&gt;
          &lt;/select&gt;&lt;br&gt;
          &lt;button type="submit" name="submit" value="process"&gt; Process &lt;/button&gt;
          &lt;button  type="submit" name="submit" value="runFile"&gt; Run &lt;/button&gt; 
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And the bat is:</p>
  
  <pre><code>start /d "static\" myFile.exe
  </code></pre>
  
  <p>The bat file works outside Flask, but I have tried with the exe and bat both in the 'static' folder and on C:/ and seems to be completely unresponsive (no console feedback), so I assume I might be missing something important?</p>