20

I have some legacy software that only prints on printers connected via an LPT port. The machine I need to use, however, doesn't have a parallel port. Plus my printer is a USB device.

How do I trick my computer into thinking my usb printer is hooked up to the lpt port?

Further, this is for an office. I'll have admin rights when implementing the work around, but I'm shooting for a solution that works while a 'regular' user is logged after everything is set up.

2
  • 1
    I think you mean LPT port, not LTP port. LPT stands for "Line Print Terminal" and is synonymous with "parallel" when referring to printer ports. Interesting that there is an LTP tag. Can that be changed? Or maybe I'm missing something.
    – boot13
    Aug 30, 2010 at 19:24
  • @boot13, You're correct. Aug 31, 2010 at 13:54

8 Answers 8

21

You can trick Windows by using the USB printer as a dummy "network" printer connected to LPT1.

Share the USB printer

Use a share-name easy to remember, such as "Printer".

Connect the shared printer as LPT1

NET USE LPT1: \\[Computer-Name]\Printer /PERSISTENT:YES
5
  • 5
    You don't need to mess around with the Loopback Adapter. Just install the printer as normal using the USB connection. Then share it. Then use NET USE as above.
    – Alan B
    Jan 4, 2011 at 13:46
  • +1 for the "Share and NET USE" trick, though the loopback adapter is unnecessary. One thing to note, if the user doesn't have a password on their account, you need to modify the Local Security Policy (or the appropriate registry key) to make this work.
    – afrazier
    Nov 22, 2011 at 18:12
  • I have managed to do all the steps but if my PC doesn't have a parallel port, when I use net use LPT2 \\Computer-9313\Parallel /PERSISTENT:YES I get The command completed succesfully but I can't see LPT2 on hardware devices so I don't know the address of it.
    – Andres
    Sep 17, 2013 at 23:27
  • 1
    @Andres did you forget to type a semicolon after LPT2 like above?
    – phuclv
    Jun 19, 2014 at 8:04
  • 1
    That's a colon, not a semicolon ( ; vs : ) Sep 23, 2014 at 16:12
5

Using a USB to parallel adapter doesn't make any sense. Here we are speaking about using a very old legacy software on hardware with USB only connections. In my case, a ZEBRA label printer.

The solution in my case was.

  1. Install the USB printer with its drivers (just to find on which USB port is connected)
  2. Change the driver's port to FILE (and free up the USB port)
  3. Install a Generic / Text Only driver and change the port to the same logical USB port as seen on point 1
  4. Share the Generic /Text Only printer in order to make it visible easily in VBA
  5. Install the Microsoft Loopback adapter on a fixed unused IP address (otherwise your printer will be not visible when the cable is disconnected)
  6. Assign a LPTx: port as explained before by command line (this is for every SW that needs an old LPT)

With few rows of code you will be able to send ASCII codes to the printer as used in the past.

Now you can easily print in VBA (tested with Windows 7 64-bit and ZM400 Zebra printer)

Open "\\Kb\ZM400" For Output As #1       'Kb = computer Name; ZM400 = Shared printer name
For rows = 1 To 37 ' send the first 37 rows of ASCII codes from the worksheet "STRINGS"
    Print #1, Worksheets("STRINGS").Cells(rows, 1).Value
Next
Close #1
2

Perhaps check out WinPrint:

Takes standard printer output produced by a DOS application, and forwards it to a default Windows printer. Converts code page, strips empty pages, supports BOX DRAWINGS chars. Works on all Windows platforms.

2

Use DOS Print Program to manipulate your available ports to desired devices. You can download it from this link https://www.dropbox.com/s/gdx05sckmbqnast/dosprint.exe?dl=0 (dos Print)

https://www.dropbox.com/s/alf6hdd5fctepmo/dosprintui.exe?dl=0 (dos Print UI)

First run dosprint and dosprintui as administrator, after then double click on the dosprintui tray icon, you can get the list of availble ports to map, then double click on lpt1 or in set button and choose your desired printer to map on it and click on ok. BINGO now you can print to the LPT1 port and your usb printer will print that for you.

2

DOS programs are still used in the world of business. Advice on how to get them working properly on a modern computing platform is rampant on the Web. Here's what worked for me.

The 16-bit DOS program we need to work with resides on a 32-bit Windows 2003 server that will soon be removed. Until then, a share to the program is mapped on two 32-bit client machines from the primary domain with Group Policy. A shortcut to the .cmd file that fires up the program is placed manually on the clients, also on the primary domain. The program runs well on Windows 8.1. A bit of a compromise to be sure, but the machines will be upgraded to 64-bit Windows 8.1 when the DOS program, which runs from the secondary domain, is retired.

Printing from the program presents the biggest challenge. Two different parallel printers are used with this program, but the program prints to a single port only and there is no option to change this behavior. Need to print a check to the laser printer? It needs to be attached to port LPT1. Need to print a data dump to the dot matrix printer? It needs to be attached to port LPT1 as well. Two people work with this program daily, so we'll use their computers, one for each printer. Let's install the first printer:

  • If the computer has a physical DB-25 (parallel) port you can disable it in the BIOS. Windows 8.1 will not support it and we don't need it.

  • A Cables-to-Go model 16899 USB to DB25 parallel printer adapter is used to connect the printer to the computer. The adapter installs automatically and is not recognized as a parallel device or LPT port.

  • Now open Devices and Printers. Click Add printer and select The printer I want is not listed. At the next dialogue choose Add a local printer or network printer with manual settings and, at the next dialogue, Use an existing port. Select a virtual printer port for USB, either USB001 or USB002, from the list and not the LPT port options.

  • The first printer is a Panasonic KX-P1191 Multi-mode dot matrix printer. The printer is not listed in the dialogue box that asks for a driver and updating the list by clicking Windows Update doesn't help. A check of Panasonic's support site indicates the printer is completely unsupported at this point, but a Panasonic technical support specialist helped puzzle out the trail that led to the Epson FX Series 1(80) driver included with Windows 8.1. It works perfectly.

Now the printer is installed. But it is on port USB001 and the program will only print to port LPT1. The solution is relatively straightforward and can be integrated right into the batch file that is used to start the program. Let's get old school and play a trick on our printer: we'll share it and print to LPT1 that way.

  • Right-click the printer and choosing Properties. Share the printer, do not list it in the directory, create a short share name just for good measure, and then ensure the user of the client machine is listed in the Group or user name area under the Security tab.

  • The two people who will be printing to these printers create my paycheck, so I gave them Domain Admin rights. That may have been unnecessary. Both are users on the primary domain but not the secondary, and I didn't want to spend time troubleshooting the permissions issue.

Now modify the batch file and use the well-documented net use command to implement the printing solution:

@echo off
::delete the printer
net use lpt1 /delete
::add the printer
net use lpt1 \\\COMPUTER\PRINTER /persistent:yes
::fire up the nasty ol' DOS program
<existing syntax used to start the program>

Where COMPUTER is the name of the computer and PRINTER is the share name of the printer. The procedure worked equally well on a second computer for the HP LaserJet 1100 printer using the "HP LaserJet 1100 (MS)" driver supplied with Windows 8.1.

-- NOTES --

System Error 5:

Ensure the user is listed under the security Tab. "Everyone" can be removed. Are Domain Admin privileges required for the user? Probably not, if everything is running from one domain.

System Error 66:

Check your syntax. You probably misspelled the name of the computer, the printer, or maybe missed the colon? Only one colon is needed, per the Microsoft documentation. Will adding an unnecessary colon to lpt1[:] cause failure?

All about net use: https://technet.microsoft.com/en-us/library/bb490717.aspx

0

There are plenty of "parallel to usb adapters" on the market. You can get one online for around $10, and it's probably a good place to start.

2
  • The issue isn't getting the printer hooked up to the computer - it's hooked up. The issue is getting the USB printer to act like it's hooked up to a LTP port (a virtual LTP port). Aug 30, 2010 at 19:23
  • But he doesn't have a parallel port, and does have a USB printer. Aug 30, 2010 at 19:24
0

You haven't said what hardware you're using, but assuming it's a Wintel PC, you should be able to buy a generic parallel port card for it for next to nothing. Aside from that, you can redirect it using NET USE, as suggested by harrymc.

0

I was in the same position with custom designed business Clipper based software. Looked at some parallel emulation software to to print to a usb printer which worked somewhat but had their own problems. Overcoming the 64 Bit win10 no dos problems was a real challenge.

I found Harbour HMG which, after changing a few lines of code recompiled the app software to 32 bit. I also have my apps write data to temp files which I grab with Microsoft Access to put out some awesome formatted reports. Oh, BTW. Now the apps work in 64 Bit windows 10 with major improvements in memory and speed. Also, I have the reports sent to usb line printers or ink jets or whatever I choose.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .