Ihave a regular network and a USB printer. Can't seem to make the USB printer print anything from a DOS window or a DOS application. It shows the document being spooled, reports falsely that it has "printed" and that's it. All I get is a report that printing was successful, no errors or anything, but nothing printed!! I''ve tried net use but still nothing . Can anybody help?
Who is Participating?
Look here :      
What printer is it?
Share the printer, i.e., "printer".

From the computer attached to the printer, open a cmd prompt, and type in NET USE LPT1: \\computername\printer

Now from the DOS application, try to print the LPT1 device.

This is flaky at best, but has extended the life of DOS apps on many occasions.

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

I tested this from "Edit" and it worked fine from a HP 6122 printer.
The net use trick works, but only if the printer supports PCL, PostScript, or plain text. If it's a raster-based printer, it will never work.

The link to dosprn that nobus gave is probably your best bet. However, even that will require a DOS window, and won't work in true DOS.

ykampAuthor Commented:
It's a HP 1020. Thank you for your advice but I've already tried these and nothing works. It must be some other way to emulate a usb port to work as an SPP LPT port. The problem is that I don't want just to print from DOS. I need to print from a dummy dos application that doesn't recognise any drivers or printers but just send a print job to a Standard LPT port.

Thanks anyway

The 1020 is a raster printer. There's no way you'll get it to accept plain text without a third party utility. Dosprn should do the trick. From what I can see, that app takes the text output from your DOS app and converts it to the GDI that the 1020's driver expects.

It's unfortunate that you don't have a LaserJet 1000, as that includes a DOS driver that captures the data going to the LPT1 port and re-routes it to the driver for interpretation.

Still, Dosprn should do the job.

Another option would be to setup the Generic/Text Only printer. Set it either to File (so you'll be prompted to save to file) or to a local port named something like "c:\text.prn" so it will always output to the same file. Then, use the net use LPT command Mad Jasper mentioned. From that point, everytime you print, you'll generate a text file.

Then, you can do one of two things. You can manually open the file in Notepad and print it (in which case, you'll probably want to set the port to c:\dos.txt or something to make it easier to open). Or, you can setup GhostScript to look for that file and automatically send it to the 1020.
thoffman is correct, raster (or "host-based") printers will not print from DOS, you will have tochange the printer or use a third party application.
This is because they rely on the windows GDI api to print at all.
You could try a parallel to usb convertor, but in my experience, these have their own issues.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.