title: Open Cash Drawer from Browser
body: <p>I am trying to open a cash drawer from a Linux-share hosted PHP page. The cash drawer is a MMF POS connected through a POSX USB adapter (no receipt printer to trigger the drawer). I can run a batch file to trigger the cash drawer to open. I have not found a way to execute the .bat file from a PHP page (preferably a button on my page).</p>
  
  <p>Batch file open.bat</p>
  
  <pre><code>Copy /b open.txt COM4
  </code></pre>
  
  <p>open.txt (unicode)</p>
  
  <pre><code>瀛─ഥ
  </code></pre>
  
  <p>I copied the open.bat and open .txt to c:\opendrawer of the computer connected to the POSX. I have tried creating a opendrawer.php page with the following code:</p>
  
  <pre><code>&lt;?php system('cmd.exe /c C:\opendrawer\open.bat'); ?&gt;
  </code></pre>
  
  <p>It did not trigger the cash drawer to open. No error message either.
  I also tried:</p>
  
  <pre><code>exec('start c:\opendrawer\open.bat');
  </code></pre>
  
  <p>I also know that from CMD the following command will open the register. Is there a way to setup a button on my PHP page to execute it. </p>
  
  <pre><code>echo ^G&gt;COM4
  </code></pre>
  
  <p>Does anyone have a suggestion on how to get this cash drawer to open with a button click on a PHP page? Many thanks.</p>