Server Side Printing

C

ccg

I am trying to print a file from an ASP script but haven't been able
to find any way of making this happen.

I have an EPL (Eltron Thermal Printer language) file that is being
generated from the script and I want a way to print this file. An EPL
file is basically printed the same way as a postscript PRN would be
printed. From a command prompt I can type:

copy label.EPL LPT1

and get the thing printed. I want to be able to do this same thing
within ASP.

I have tried creating a batch file and calling that from ASP using the
code at http://www.aspfaq.com/show.asp?id=2059 but that didn't seem to
work. I did give permissions to CMD and Command but it's still not
working. Is that because "copy" is part of Command? I also tried
DynuExec but that didn't do the trick either.

Is there any way to copy a file to LPT1 from within an ASP script at
all? How about JavaScript? I'm ok with any kind of creative
solutions...it doesn't have to be elegant since this will only be used
as an internal application.

Thanks in advance for any advice or suggestions.

Corbin G

email me at my first name and first letter of last name at the google
mail service domain
 
R

Ray Costanzo [MVP]

What does your batch file look like and the code that you're using to
execute it?
 
C

ccg

print.asp contains
set wshell = CreateObject("WScript.Shell")
wshell.run "c:\inetpub\wwwroot\ups\print.bat"
set wshell = nothing

print.bat contains:
copy c:\inetpub\wwwroot\ups\label.epl lpt1

I also tried changing the path in print.bat to be the local path:

copy y:\ups\label.epl lpt1

The page loads and doesn't give any errors but nothing prints.

Thanks for your assistance.
 
C

ccg

I am logged onto the server when I print it from the workstation.
But, I assume you mean from the server itself? If so, then I have not
tried it. The server is not setup to use this printer at all.
 
M

Mark Schupp

Your ASP code is trying to print on the server, not on the client. Only a
printer attached to the server can be used the way that you describe.

In order to use a printer on the client you will have to download the data
file and then use client-side code to print it (will probably need a
client-side component for that). Try asking on a client-side group.

--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
 
R

Ray Costanzo [MVP]

Try mapping LPT1 to a printer first.

net use lpt1: \\server\printshare
copy y:\ups\label.epl lpt1
net use lpt1: /d


Is Y: a local drive?

--

Ray at work
Microsoft ASP/ASP.NET MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,265
Messages
2,571,069
Members
48,771
Latest member
ElysaD

Latest Threads

Top