Printing to LPT2

Printing to LPT2

Post by Norm Dresne » Tue, 03 Nov 1998 04:00:00



I have a computer on which the scanner is on LPT1 and the printer is on
LPT2.  The scanner is used only from Win95 programs.  But programs in DOS
shells do need to reach the printer.

The question is this:
        How can my DOS programs know that PRN is LPT2 without messing up the Win95
setup?  Or do I have to explicitly have to print to LPT2 in DOS instead of
PRN?

        Norm D.

 
 
 

Printing to LPT2

Post by Tom Laveda » Tue, 03 Nov 1998 04:00:00



> I have a computer on which the scanner is on LPT1 and the printer is on
> LPT2.  The scanner is used only from Win95 programs.  But programs in DOS
> shells do need to reach the printer.

> The question is this:
>         How can my DOS programs know that PRN is LPT2 without messing up the Win95
> setup?  Or do I have to explicitly have to print to LPT2 in DOS instead of
> PRN?

>         Norm D.

If the DOS programs can be configured to LPT2, by all means do that.
However, if you have a truly ancient relic that won't do it, then you're
welcome to try the following routine which swaps LPT ports (PRN=LPT1).
You will need to execute the procedure for each DOS window session.
Don't include it in the AUTOEXEC.BAT as this will almost certainly mess
with the Win 95 definitions (though I haven't specifically tested it).

 ::  SWAP.BAT - A routine to swap LPT port addresses

 ::              http://www.pressroom.com/~tglbatch/

 %8 if [%2]==[] echo  Syntax: %0 #1 #2 (LPT ports 1, 2 or 3)
 > {S} if [%2]==[] goto:End
   for %%v in (21 32 31) do if %1%2==%%v %0 %2 %1
   if %1%2==12 %0 M0:408L6 100 M100L2 0:40A M102L2 0:408 Q goto:Swap %1
%2
   if %1%2==23 %0 M0:408L6 100 M102L2 0:40C M104L2 0:40A Q goto:Swap %1
%2
   if %1%2==13 %0 M0:408L6 100 M100L2 0:40C M104L2 0:408 Q goto:Swap %1
%2
   for %%v in (echo goto:End) do %%v Swap ERROR - Nothing done.
  :Swap
 >>{S} echo %1 %2
   if not [%5]==[] for %%v in (shift shift goto:Swap) do %%v
 < {S} debug > NUL
   echo Swap Complete - LPT%3 exchanged with LPT%4
  :End
   del {S}

The routine makes use of the standard DEBUG.EXE utility to effect the
swap.  Any line starting in the first column has been wrapped from the
previous line.  Restore it to the end of the previous line with a
leading blank.  Questions about unusual statement syntax can be
addressed by reviewing the general notes at my web site.  

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/

 
 
 

Printing to LPT2

Post by Norm Dresne » Thu, 05 Nov 1998 04:00:00


The easy part is swapping the printers.  The hard(er) part is getting it
done "automatically".  The solution to that is:
1. Confgure COMMAND.COM and add /K Swap1&2
        where Swap1&2 is a program to swap the ports
2. For any other program which create a DOS shell, add in the properties
section for "BAT FILE" the name of a .BAT file that invokes Swap1&2 which
will run before the command itself.

        Norm D.

 
 
 

1. How can I print to LPT2?

I have had to move my printer to my LPT2 card. It's easy to
change in Win98 but I can't work out how to use LPT2 from MS-Dos
6.2. It seems that the device PRN by default points to LPT1 and
somehow it needs to be pointed to LPT2. The Dos 5 manual is no
help on this that I can see nor the on-line help with Dos 6.
Does anyone know? Thanks.
--
Paul
[email Paul AT fidcal.com]

2. How to upgrade Tornado 1.0.1 to 2.0?

3. Is printing to lptx: (lpt2: etc) a standard solution?

4. printer

5. Redirect PRINT SCREEN to LPT2?

6. Open Source Java GUI test

7. Redirect LPT1 to LPT2???

8. Suggestion for floppy controller?

9. Printing a print file to a networked printer

10. Printing through Print Manager

11. rerouting lpt1 to lpt2- HELP!!!

12. Redirecting to LPT2

13. Printer Port from Lpt1 to Lpt2 Help!!!!!!!!!