For years I printed from batch files using the following:
to set up: Net Use LPT2: "\\asrock-pc\lexmark e260d" & if you like /persistent:yes
then applying you put in the batch file echo what a nice day > LPT2 & the printer prints it.
well the above monochrome laser printer died and I cannot get the command to work on another printer. I tried two color laser printers one a Lexmark and No! I then tried another
monochrome brother printer and it not work but a least the print command worked.
in all of the above you get no exceptions it just NOT print!
for example on the monochrome brother : net use LPT2: \\asrock-pc\brother /persistent:yes
and then echo what a nice day > LPT2 does not work BUT the following works
print /d:\\Asrock-pc\brother hello.txt gives you a dos line saying hello.txt is currently being printed AND IT PRINTS! ( with the two color printers you get the currently being printed line but nothing prints. ) What also works is print /d:LPT2 hello.txt
So what is the solution please!!
As we heavily use this command sequence I have ordered a used e260d. But if you guys come up with a solution i can use ALL my printers!
Roe5685
command line printer problem using echo lpt2 commands
Moderator: DosItHelp
Re: command line printer problem using echo lpt2 commands
I believe this has to do with most newer printers being GDI (Host Based) Printers.
Re: command line printer problem using echo lpt2 commands
Two things may be a work here.
One is that you need to make sure lpt2 is 'captured' by the printer driver. It's like a drive mapping. If it's not, the echo is going nowhere.
Second is that a lot of newer printers need an end of file or end of page or line feed sent to them for them to print. I'd run across this on our Panasonic kxp-4450i when doing dos echos even back in the win 3.1 days.
I'd love to hear if you get it working. I still use some old dos programs and have to make sure printers can work old-school like your situation.
One is that you need to make sure lpt2 is 'captured' by the printer driver. It's like a drive mapping. If it's not, the echo is going nowhere.
Second is that a lot of newer printers need an end of file or end of page or line feed sent to them for them to print. I'd run across this on our Panasonic kxp-4450i when doing dos echos even back in the win 3.1 days.
I'd love to hear if you get it working. I still use some old dos programs and have to make sure printers can work old-school like your situation.
Re: command line printer problem using echo lpt2 commands
If it is as Squashman assumes (printer does not support PCL6, only GDI), then maybe applications like DOSPRN (Shareware) may help you (i've never tested this application, only heard of it):
http://dosprn.com/
penpen
http://dosprn.com/
penpen
Re: command line printer problem using echo lpt2 commands
Roe5685 wrote:What also works is print /d:LPT2 hello.txt
The previous posts have a lot of info, but to me your task is not clear,
as you've said that you want to use echo what a nice day and print to the printer
and you've said that print /d:LPT2 hello.txt works.
So using those things then it follows that you can do this:
Code: Select all
@echo off
>"%temp%\print.tmp" echo what a nice day
print /d:LPT2 "%temp%\print.tmp"
del "%temp%\print.tmp"
And with this batch file you use the following: call EchoPrint.bat Printing Ink is as expensive as Caviar!
EchoPrint.bat
Code: Select all
@echo off
>"%temp%\print.tmp" echo %*
print /d:LPT2 "%temp%\print.tmp"
del "%temp%\print.tmp"