title: How to execute .bat file in PHP from remote server?
body: <p>I am trying to execute following code in PHP. It runs, but returns the result of my local system, where I need the bat file should run on remote system.</p>
  
  <pre><code>if( pclose(popen("cmd /c "."\\\\ServerName\path\Test.bat", 'r')) ) {
      return true;
      }
      return false;
  </code></pre>
  
  <p>Test.bat
  DIR > mohit.txt
   and I see mohit.txt is created in my local machine root directory, where as I was expecting to have the file on remote server in same directory.</p>