473,396 Members | 1,789 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,396 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 1357

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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.