title: How to automate printing using .bat file by call using javascript/jquery
body: <p>I have web application and it have a print function. It simply print some HTML aligned content using a Dot matrix printer. But in web application it prints in Graphics mode, due to this printing is <strong>very slow</strong>. So I tried the solution using the <a href="http://www.codingforums.com/archive/index.php/t-235333.html" rel="nofollow">link</a>. My print method as follows:</p>
  
  <pre><code>var data=[].slice.call($("#printdiv").find("table tr")).map(function(row){
                  return row.textContent.trim().replace(/\n/g,"\t");
              }).join("\n");
  
  window.open("data:application/print;," + escape(data));
  </code></pre>
  
  <p>My <code>print.bat</code> as follows:</p>
  
  <pre><code>notepad /p %1
  </code></pre>
  
  <p>When I click print button it simply download a file and then it needs to be open with print.bat file to print and it works perfectly.</p>
  
  <p>How can I automate that. I mean on clicking print function I want call the print.bat file and need to pass the content or notepad file to the bat file and should work without manual intervention.</p>
  
  <p>I tried to call .bat file using ActiveXObject but it is not working in anywhere (not even working in IE).</p>
  
  <p>How can I automate calling .bat file from browser using javascript/jquery and automate printing?</p>