How to execute .exe file on a windows server via PHP?
<p>I have php installed on my windows vps and available to access via port 80 and from my home PC.</p>

<p>Created an <strong><em>auto.php</em></strong> file which should trigger a file name <strong><em>Filename.exe</em></strong>.</p>

<p>Here is the code i have written (stolen from all over the net and worked on it)</p>

<pre><code>&lt;?php
exec('c:\WINDOWS\system32\cmd.exe /c START C:\xampp\htdocs\myy\Filename.exe');
    echo "Game server has been started";
?&gt;
</code></pre>

<p>But when ever i click on auto.php, it does not execute, However I can see a new command prompt is opened in Task Manager, but Filename.exe is not executed.</p>

<p>However if i create a bat file named lets say <strong><em>test.bat</em></strong> with the following command</p>

<pre><code>copy NUL test.txt
</code></pre>

<p>and change the ending part of the script to test.bat instead of Filename.exe</p>

<p>i.e.</p>

<pre><code>&lt;?php
exec('c:\WINDOWS\system32\cmd.exe /c START C:\xampp\htdocs\myy\test.bat');
    echo "Game server has been started";
?&gt;
</code></pre>

<p>It does create a file named test.txt, but if i change the command to</p>

<p>START Filename.exe </p>

<p>it still doesnt get launched, am not sure what am I doing wrong here.</p>

<p>Please help.</p>

<p>My end game is to be able to launch filename.exe (is in same folder as of auto.php) to run remotely from browser..</p>