473,386 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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_user.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\ipoprp\VisitorPassEntry.txt > LPT1

mention in javascript:

Expand|Select|Wrap|Line Numbers
  1. MyObject = new ActiveXObject( "WScript.Shell" )  
  2. function Runbat()   
  3. {  
  4.  MyObject.Run("C:\\PRINT.bat")   
  5. }
How to pass the path to batch file
Dec 19 '14 #1
0 1355

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Sergio Otoya | last post by:
Hi all, Is there any way of copying a file using javascript, not using the Filesystemobject (ActiveX). I need this to run in Windows and MACS. Any help would be greatly appreciated. Thanks...
2
by: DB | last post by:
Hi All, I have to execute dos command containing batch file using asp.net application. Code for batch file execution is working properly when I tried it with console application but same code...
3
by: Chris | last post by:
Hi, How can I execute a batch file form asp.net app. I have a form which a user uploads a text file. after the file is uploaded I want a batch file to then execute and do some work. Thanks
1
by: coosa | last post by:
Hi all, As the topic describes, I'd like to run a batch file using sql server. How do i do it? Thanks in advance
1
by: guitarsajee | last post by:
hi.. i want to know how to validate file tag using javascript... plz let me know soon as possible.. thanx...
0
by: Elroyskimms | last post by:
I need to execute a batch file via ASP.Net. In my VB.Net code, I'm using System.Diagnostics.Process to call the batch file and its appropriate command line arguments. I'm using...
3
Frinavale
by: Frinavale | last post by:
Hi there! I'm hoping that someone knows how to check the size of a file before it is uploaded to the server using JavaScript. I have seen suggested solutions using an ActiveX control to check...
1
by: Ira Sinha | last post by:
I have created a batch file, which is using 7z command to encrypt and compress a file. The command in the batch file is 7za -TZIP a -p I am able to run the batch file successfully from the...
2
by: huiling25 | last post by:
I tried for several days, but none can work. IE keep showing yellow exclamation mark at the status bar after clicking "Submit" and batch file cannot be executed. The HTML file and batch file is in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.