Page 1 of 1

Printing from a DOS App to a USB port in Windows (98 or XP)

Posted: Mon Apr 03, 2006 2:25 pm
by Zim
How do I do that?

DOS editors like Dos Edit and QB are looking for LPT1: but the printer is on a USB port. Years ago I used a MODE command to map an LPT port to a serial (COM) port, but how do I map to a USB port so I can use my new printer with DOS programs?

Posted: Mon Apr 03, 2006 4:33 pm
by {Nathan}
When you install the printer (add a printer) you must click "Yes" to "Allow DOS programs to print" or something like that then set it to LPT:1, Then, you can just use the LPRINT statement.

Posted: Wed Apr 05, 2006 10:42 am
by Zim
Ok, I remember seeing that in Win95. I'll have to look for it in Win 98/XP. My son installed the printer so I'll bet he can help.

Thanks a lot!

Posted: Wed Apr 05, 2006 2:26 pm
by Antoni
If this don works you can print to a file then shell to notepad with /p option

Code: Select all

shell "notepad /p yourprintfile.txt"
This should work with any printer that works in Windows.

Using Notepad

Posted: Thu Apr 06, 2006 11:29 am
by Zim
Actually, this is a good solution, and one which I tried. I sent my output to a text file and opened it using Windows Notepad with the intention of printing from there.

Problem is, my program's output contained hi-bit Ascii characters for line drawing. In NotePad, these characters look like special (foreign) characters 'n stuff, but not lines. And that's the way they'd print too.

But thanks, anyway! Since the advent of Windows I try to NOT use upper Ascii graphics characters so that my files print the same from both DOS and Windows.

Note: what I actually ended up doing was installing a special "DOS Video Terminal Font" in Windows so that the line-drawing characters showed up correctly, then I printed from Notepad.

Re: Using Notepad

Posted: Thu Apr 06, 2006 8:52 pm
by moneo
Zim wrote:......
Problem is, my program's output contained hi-bit Ascii characters for line drawing. In NotePad, these characters look like special (foreign) characters 'n stuff, but not lines. And that's the way they'd print too.
......
I had a similar problem years ago. Solutions:
1) On an option or switch in your program, strip the hi-bit on characters to be output.
2) Write a simple little program which inputs the text, strips the hi-bit of each character, and writes to a temp output file. This is what I ended up doing.
*****