title: Starting Programs From PHP
body: <p>I have Windows 7 x64 with XAMPP installed. How can I start .bat files located on my webserver?</p>
  
  <p>I tried with</p>
  
  <ol>
  <li>exec(); </li>
  <li>system();</li>
  <li>shell_exec();</li>
  <li>popen();</li>
  </ol>
  
  <p>And with commands like</p>
  
  <pre><code>dir c:
  </code></pre>
  
  <p>It works.</p>
  
  <p>But if I try with</p>
  
  <pre><code>notepad text.txt
  </code></pre>
  
  <p>No applications start!</p>
  
  <p>Yesterday I tried with allocating the Python directory in the environment variables and I tried to start my program like this:</p>
  
  <pre><code>%python%/python teamviewer_start.py
  </code></pre>
  
  <p>and it worked yesterday, but not today/</p>
  
  <p>My idea was to make a little "control panel" to start some programs directly from the Net, like TeamViewer, ThinVnc or Ammyy Admin. How can I do something like this?</p>
  
  <p>This is my Python script:</p>
  
  <pre><code>import subprocess
  
  import os
  
  import wmi
  
  os.system("start /b C:\Progra~2\TeamVi~1\Version6\TeamVi~1.exe")
  </code></pre>
  
  <p>This, in local, starts...
    </p>