Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question already has an answer here:

I have a program which I have used for many years which manages the printing of text files according to control statements within the text file.

For instance, it will print headings at the top of each page, change lines per inch, change characters per inch, set margins, change from portrait to landscape, etc. It does this by writing control strings directly to the printer, addressing the printer as LPT1, LPT2, or LPT3.

Now I need to use it to address a printer connected to a USB port, but I don't know how to address it.

Printer properties tell me that the printer is connected to port "DOT4_001", but when I attempt to write to that port, it simply creates a file in the current directory with that name and does not write to the printer. Similarly, I cannot figure out how to write to that printer from a DOS window with the simple command "type file.txt >xxxx", although substituting "LPT1:" for "xxxx" works with a printer connected to a parallel port.

So my question is "How do I directly address a printer which is connected to a USB port?"

share|improve this question

marked as duplicate by Ƭᴇcʜιᴇ007, Tog, Mokubai, Breakthrough, Dave M Sep 25 '13 at 19:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

If your USB-printer is compatible with the codes your program sends (for example PCL) then you can do the following:

  • Share your printer (and give it a simple name, i.e. MYPRINTER)
  • Open a command prompt
  • Type NET CONFIG WORKSTATION and note your "Computer Name" at the top. (i.e. \MYCOMP)
  • Type NET USE LPT1 \\MYCOMP\MYPRINTER /PERSISTENT:YES
  • Type exit

Now you can print to LPT1 and Windows will redirect the output to your USB-printer.

share|improve this answer

I noticed that the OP wants to print text files. Many USB-only printers are what's called GDI printers, which rely on the Windows graphics engine to convert the page into dots on the paper. These printers do not understand text - or PCL for that matter. Hence, Rik's solution will not work for those printers. We need the printer model to make certain.

However, there is another option. DOSPRN is designed to take the text or PCL output from the program, and convert it into something the printer can understand. It works well, and it's a free download.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.