Print from DOS app under XP

  • Thread starter Thread starter vex
  • Start date Start date
V

vex

I need to print to a USB MFP from a DOS app under XP. When I issue a
MODE command it finds COM3: (modem) and CON: but not the printer. When
I try to PRINT a file XP responds;

Unable to initialize device PRN

Is there some magickry to do with NET USE to enable DOS printing, or
this DOSPRN shareware app? What's the simplest solution which involves
least work for my users? Thank you for answers.

(An answer which works also for Ethernet networked printers would be
great, as would something which will work also in Vista and win2k)
 
I need to print to a USB MFP from a DOS app under XP. When I issue a
MODE command it finds COM3: (modem) and CON: but not the printer. When
I try to PRINT a file XP responds;

Unable to initialize device PRN

Is there some magickry to do with NET USE to enable DOS printing, or
this DOSPRN shareware app? What's the simplest solution which involves
least work for my users? Thank you for answers.

(An answer which works also for Ethernet networked printers would be
great, as would something which will work also in Vista and win2k)

1. Share your printer.
2. Link it to an LPT port:
net use LPT2: \\%ComputerName%\PrinterShare
3. Send the print stuff to LPT2:
copy c:\print.prn LPT2:.
4. Eject the page if necessary:
echo Ctrl+L > LPT2:
 
I need to print to a USB MFP from a DOS app under XP. When I issue a
MODE command it finds COM3: (modem) and CON: but not the printer. When
I try to PRINT a file XP responds;
Unable to initialize device PRN
Is there some magickry to do with NET USE to enable DOS printing, or
....[snip]....

First, try redirecting the output of

TYPE FileName > PRN:
TYPE FileName > LPT:

I forget (I'm NOT using a Windoze machine to write this, so I can't
test it right now), but one of them has worked for me in EVERY
version of Windoze I've tried, INCLUDING BOTH WXP/home with a
parallel-port printer (HP 3820) and WXP/prof with (I think) a
networked printer (don't remember its name; I was doing volunteer
work in somebody's office). To get the page to eject, you'll
probably also need to send a CTRL-L to the same output port.

If either of the above work, then put a CTRL-L in a file
called EJECT and put the two commands:

TYPE %1 > WhatEverWorked
TYPE EJECT > WhatEverWorked

in a file called PRINT.BAT, and you'll have a rudimentary PRINT command.

To print MULTIPLE FileName(s) with one "print" command, you can
enlarge PRINT.BAT something like this:

:Loop
TYPE %1 > WhatEverWorked
TYPE EJECT > WhatEverWorked
SHIFT
IF NOT "%1" == "" GOTO Loop

Put EJECT in some convenient directory, put PRINT.BAT in your PATH,
and change "TYPE EJECT..." to include the full PATH name for EJECT,
and you can then forget that Windoze's "DOS" didn't have "PRINT".
 
First, try redirecting the output of

TYPE FileName > PRN:
TYPE FileName > LPT:

I forget (I'm NOT using a Windoze machine to write this, so I can't
test it right now), but one of them has worked for me in EVERY
version of Windoze I've tried, INCLUDING BOTH WXP/home with a
parallel-port printer (HP 3820) and WXP/prof with (I think) a
networked printer

It seems you have never used a USB printer, and no, it won't
work for a printer that is accessible via a network only.

Best to test before you post.
 
Pegasus,
1. Share your printer.
2. Link it to an LPT port:
net use LPT2: \\%ComputerName%\PrinterShare
3. Send the print stuff to LPT2:
copy c:\print.prn LPT2:.
4. Eject the page if necessary:
echo Ctrl+L > LPT2:

this may work only if the printer itself is DOS compatible.
Many USB MFP nowadays are GDI (AKA Windows-Only). For printing to this kind
of printers from DOS you may want to have a look at Printfil.
More info and a free trial version is available for download at
http://www.printfil.com

Kind regards,
Davide Guolo
aSwIt s.r.l.
--------------------------------------------------------------
Printfil - Windows Printing System for Applications
http://www.printfil.com
Odbc4All - Connection to ODBC Data Sources for any Application
http://www.aswit.com/odbc4all
--------------------------------------------------------------
 
I need to print to a USB MFP from a DOS app under XP. When I issue a
MODE command it finds COM3: (modem) and CON: but not the printer. When
I try to PRINT a file XP responds;

Unable to initialize device PRN

Try using LPT1:.
If this doesn't work you printer is not recognised or taken exclusively
by Windows or one of its applications.
You may need a "capture" statement in your commands, but I regret I
forget the format of this and have no reference at hand.
 
There is one major problem with this post: a USB printer is NOT on
LPT1: which is a parallel port!

Assuming you pc name is PC and your printer is shared with the name
PrtShr, the capture command you want (I hope it works as I don't have a
USB printer to test it >{ )
NET USE LPT1: \\PC\PrtShr

Also, IIRC, PRN is no longer supported in the later versions of
Windoze.
 
bruce said:
There is one major problem with this post: a USB printer is NOT on
LPT1: which is a parallel port!

Another major problem is that the printer may not be DOS compatible -
that is, it may not be able to take raw text input and produce printed
output and may instead rely on drivers to rasterize the input to produce
output. Most USB-only printers I've dealt with are like that, but I
seem to recall some printers that provided DOS functionality in their
drivers by setting up a virtual LPT port. These days, the only printers
I'm aware of that still directly support DOS are a couple of models of
HP printers.
Assuming you pc name is PC and your printer is shared with the name
PrtShr, the capture command you want (I hope it works as I don't have
a
USB printer to test it >{ )
NET USE LPT1: \\PC\PrtShr

That does indeed work for USB printers that are shared, and should work
for any shared printer. The problem again is whether or not the printer
can print from text-only input. You can test this by trying DIR > LPT1
after issuing the NET USE command. If you get a printed directory
listing, you should be good to go (you'll probably have to issue a form
feed to get the page to eject, by either using the front panel controls
or Myron A. Calhoun's suggestion above.)
Also, IIRC, PRN is no longer supported in the later versions of
Windoze.

PRN appears to be supported in XP Pro SP2 - at least, with a
DOS-compatible printer attached to LPT1, I can type DIR > PRN at a CMD
prompt and get a printed directory listing.

Regards,

Dave
 
Dave said:
Another major problem is that the printer may not be DOS compatible -
that is, it may not be able to take raw text input and produce printed
output and may instead rely on drivers to rasterize the input to produce
output. Most USB-only printers I've dealt with are like that, but I
seem to recall some printers that provided DOS functionality in their
drivers by setting up a virtual LPT port. These days, the only printers
I'm aware of that still directly support DOS are a couple of models of
HP printers.
That would explain why my vendors flat out say their program will NOT
print to USB!
PRN appears to be supported in XP Pro SP2 - at least, with a
DOS-compatible printer attached to LPT1, I can type DIR > PRN at a CMD
prompt and get a printed directory listing.
Thanks Dave. Perhaps our new machines having NO parallel or serial
ports led me to believe that it wasn't supported.
Bruce
 
Thanks Dave. Perhaps our new machines having NO parallel or serial
ports led me to believe that it wasn't supported.

I think you can try to use another software which can print DOS reports
on the modern printers. This is a simple, power and inexpensive DOS
printing utility.

Visit http://www.dosprn.com and look around for additional information.
 
I tried this site.
I clicked on everything of interest to me (quite a few) and all but one
returned either nothing at (e.g. character recoding) all or the ERROR
message for invalid or unknown URL. Pity!

*** Hmm, from time to time, I have had others e-mail that links were
broken but whenever I tested, most worked. Those that didn't were, of
course removed.

Did you just try the USB links, or others?

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/
 
*** Hmm, from time to time, I have had others e-mail that links were
broken but whenever I tested, most worked. Those that didn't, were, of
course removed.
Did you just try the USB links, or others?
Richard Bonner

*** I just tested each link in the "USB" section. I found one
duplication and three dead links. All others worked. Those bad/redundant
links were removed.

Can you be more specific? I try to keep my pages up to date, but with
four websites and thousands of links, it takes several months of link
testing in my spare time to do the rounds. I'd use the W3C link-testing
service, but it locks up when testing any pages with more than a couple
dozen links or so. )-:

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/
 
Richard,
One or more links can be found in my "DOS Websites" Directory at:

http://www.chebucto.ca/~ak621/DOS/Websites.html

Printfil is not present in your page (nor the other utilities in my
signature).
Could you please add them ?

Thank you,
Davide

aSwIt s.r.l.
--------------------------------------------------------------
Printfil - Windows Printing System for Applications
http://www.printfil.com
Odbc4All - Connection to ODBC Data Sources for any Application
http://www.aswit.com/odbc4all
@Kill - Batch Close Windows Applications - Freeware
http://www.aswit.com/akill
--------------------------------------------------------------
 
Can you be more specific? I try to keep my pages up to date, but with
four websites and thousands of links, it takes several months of link
testing in my spare time to do the rounds. I'd use the W3C link-testing
service, but it locks up when testing any pages with more than a couple
dozen links or so. )-:

Here's the list of what I tried.
MS-DOS 7.10 Download dead
dBase SE special edition error
GFF DOS Image software error
Recode Package error
On-line Bible worked, but irt was the wrong
Bible (not DOS Bible)

These were the only titles which I tried.
 
Printfil is not present in your page (nor the other utilities in my
signature).
Could you please add them ?

Davide

*** Are they DOS programs? If they are, I would be pleased to add
them. (That goes for anyone else here with DOS programs or DOS
websites.)

If they require Windows - that is, if they are Windows command-line
utilities, I cannot. I want that page to be for DOS users. I decided upon
that because of all the frustrations I had had over the years when I
downloaded "DOS" programs only to find out they required Windows. GRRR!

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/
 
Terence wrote:
(Re: Dead Links at http://www.chebucto.ca/~ak621/DOS/Websites.html)
Here's the list of what I tried.
MS-DOS 7.10 Download dead *** Removed
dBase SE special edition error *** Removed
GFF DOS Image software error *** This One Works.
Recode Package error *** Waiting to see if it
returns. ( I tried it
and it simply hung.)
On-line Bible worked, but irt was the wrong
Bible (not DOS Bible) *** Waiting for
confirmation.

*** Hmm, there is a message on the opening screen about no support
for the DOS version but none about it not being available. Did you
download the software only to find it was a Windows program?

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/
 
Richard,
*** Are they DOS programs? If they are, I would be pleased to add
them. (That goes for anyone else here with DOS programs or DOS
websites.)

If they require Windows - that is, if they are Windows command-line
utilities, I cannot. I want that page to be for DOS users. I decided upon
that because of all the frustrations I had had over the years when I
downloaded "DOS" programs only to find out they required Windows. GRRR!

No, they are Windows utilities for DOS programs running on Windows machines
(by the way there are no other ways to print to Windows printers or use
Windows ODBC32 drivers in plain DOS).

Anyway, even DosPrn and Dos2Usb, which are listed on your site, are Windows
utilities.

Regards,
Davide
aSwIt s.r.l.
--------------------------------------------------------------
Printfil - Windows Printing System for Applications
http://www.printfil.com
Odbc4All - Connection to ODBC Data Sources for any Application
http://www.aswit.com/odbc4all
@Kill - Batch Close Windows Applications - Freeware
http://www.aswit.com/akill
--------------------------------------------------------------
 
Back
Top