How to execute batch file with a pathname using Javascript? (Windows XP and IE)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • surendarjreddy
    New Member
    • Dec 2014
    • 1

    How to execute batch file with a pathname using Javascript? (Windows XP and IE)

    Hi

    I have a problem with printing a text file.

    When i am inserting the data into database, created a text file with user(ex.Test_us er.txt). But when i am giving Print the bill from dot matrix printer it will skipping the paper.

    Then i created the batch file, in that batch file manually i mentioned the TYPE command with path of the file. Then it will print correctly.

    My Application is developed in classic ASP and Java script. How can i pass the path to batch file. i want to give the server path from java script to the batch file.

    Ex: serverpath/folder/test.txt.
    Printer TVS RP45

    Given in bat file like this:
    Type \\10.10.40.11\i poprp\VisitorPa ssEntry.txt > LPT1

    mention in javascript:

    Code:
    MyObject = new ActiveXObject( "WScript.Shell" )  
    function Runbat()   
    {  
     MyObject.Run("C:\\PRINT.bat")   
    }
    How to pass the path to batch file
    Last edited by Rabbit; Dec 19 '14, 04:45 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
Working...