Cannot print to DOS LPT1:

  • Thread starter Thread starter Nick Hawthorn
  • Start date Start date
N

Nick Hawthorn

I can print on an HP Laserjet 4200n printer from MS Word under
Windows 2000. If I then run the DOS command interpreter CMD.EXE,
I can't print through the DOS LPT1: printer name. (This is really
useful, believe it or not.) It used to work well. Just what
caused it to stop working I don't know, but a new printer was
installed. The DOS command

net use lpt1: \\host\printer /persistent:yes

claims to complete successfully. After that, the DOS command

copy file lpt1:

says that 1 file was copied. Watching the printer menu, the file
does appear while it is being copied, but then just vanishes.
Nothing gets printed.

Any help much appreciated. I do wonder if there is another way
of setting up LPT1:.
Thanks,
Nick Hawthorn n dot hawthorn at auckland dot ac dot nz
 
Dear Mr. Nick Hawthorn,
copy file lpt1:
says that 1 file was copied. Watching the printer menu, the file
does appear while it is being copied, but then just vanishes.
Nothing gets printed.

you may want to have a look at Printfil, which allows you to print your text
files to any Windows printer, including usb, networked and virtual printers
(faxmodems, pdf writers, ...) with many extras, like print preview, font
selection, color, bmp merging etc.

More info and a free trial is available for download at our web site.

Kind regards,
Davide Guolo
--------------------------------------------------------------
Printfil - Windows Printing System for Applications
http://www.guolo.com/printfil
Odbc4All - Connection to ODBC Data Sources for any Application
http://www.guolo.com/odbc4all
--------------------------------------------------------------
 
If you are running Windows XP mapping LPT1 to a network
share doesn't work out of the box. If you read this KB
article it has some advice: http://support.microsoft.com/?
kbid=314499. Somewhere I think that it says that "this
behavior is by design". I think mapping local ports to a
network share is some sort of security risk that they
designed out of XP on purpose.

I was able to solve this problem with a batch file with
the following line in it:

C:\devcon\i386\devcon.exe disable *PNP0401

The other lines map the Lptx: ports to various printer
shares.

I don't remember if I had to download devcon.exe from
somewhere or if it was already there. Anyway, once that
command is run on the client machine you can map lptx: to
any network share you want like before.

Make sure you complain loudly and often to the software
vendor or supplier that is making you use that software.
It has to be at least TEN years old. DOS may have been a
wonderful thing in its' day but there is no excuse for
having to use software that old on current equipment. I
complained and the company finally got around to putting
that funcionality on the web.
 
If you are running Windows XP mapping LPT1 to a network
share doesn't work out of the box. If you read this KB
article it has some advice: http://support.microsoft.com/?
kbid=314499. Somewhere I think that it says that "this
behavior is by design". I think mapping local ports to a
network share is some sort of security risk that they
designed out of XP on purpose.

Thanks for your reply, and thanks for the reference. It was some
help and I was able to download devcon.
I was able to solve this problem with a batch file with
the following line in it:

C:\devcon\i386\devcon.exe disable *PNP0401

The other lines map the Lptx: ports to various printer
shares.

If you still have the batch file, could you post it? What was it called
and where did it go? I tried adding the following lines to the end of
c:\winnt\system32\autoexec.nt.

echo Latest > c:\latest.txt
c:\misc\devcon\i386\devcon disable *PNP0401
net use lpt1: /delete
net use lpt1: \\FMHSc1\HthPsy01 /persistent:yes

The first line showed that the file was executed, by creating
latest.txt. The next three lines are your DEVCON command and NET
USE commands that ought to map lpt1 to the printer. But, lpt1:
still didn't work. It behaved just as it did before -- jobs spool
then disappear. Did you use NET USE or something else, to map Lptx:
ports to printer shares?
Make sure you complain loudly and often to the software
vendor or supplier that is making you use that software.
It has to be at least TEN years old. DOS may have been a
wonderful thing in its' day but there is no excuse for
having to use software that old on current equipment. I
complained and the company finally got around to putting
that funcionality on the web.

I admit to rather liking DOS. I use the software to make PostScript
files and other things, and don't want to print the files until my
scripts are almost working. I also use FTP to copy files from a
unix system to LPT1: on my PC. This *used* to be a convenient way
to print files. It is me who is choosing to use very old software.

I do wonder if the problem is at the printer end. I have had "cannot
initialize printer" messages. Perhaps initialization by user jobs
has been disabled at the printer -- or something -- I am just guessing.

Any help appreciated!


With thanks,
Nick Hawthorn
 
Here is my quite simplistic batch file:

C:\devcon\i386\devcon.exe disable *PNP0401
net use lpt1: \\server\hp2100_3rd /persistent:yes
exit

I put it up on a network share and just ran it whenever I
needed a machine to be able to map lpt1: to a network
server. It wasn't set up to run at login or anything.

I didn't mean to dis your homemade DOS programs ;-).
Usually when I deal with DOS stuff it's crappy, outdated,
insurance software. It's possible that your batch file
worked. When you do net use lpt1: does it show the network
share? If it is properly mapped, try recreating the local
printer and do a test page. That might get you fixed up.

Good Luck!
 
Here is my quite simplistic batch file:

C:\devcon\i386\devcon.exe disable *PNP0401
net use lpt1: \\server\hp2100_3rd /persistent:yes
exit

I put it up on a network share and just ran it whenever I
needed a machine to be able to map lpt1: to a network
server. It wasn't set up to run at login or anything.

I wound up with this:
c:\misc\devcon\i386\devcon.exe disable *PNP0401
net use lpt1: /delete
net use lpt1: \\FMHSc1\HthPsy01 /persistent:yes

After running it I still can't print. It ran without error. Whichever
way I do it from DOS (copy file lpt1 or type file > lpt1 or
print /d:\\FMHSc1\HthPsy01 p:\file), files are spooled
and appear in the printer queue for a little while and then vanish. They
never get printed. Printing from MS Word is fine.
I didn't mean to dis your homemade DOS programs ;-).

Dis away! My batch files are pretty crude.
Usually when I deal with DOS stuff it's crappy, outdated,
insurance software. It's possible that your batch file
worked. When you do net use lpt1: does it show the network
share? If it is properly mapped, try recreating the local
printer and do a test page. That might get you fixed up.

Network share -- I take it this means the remote name as below.
Recreating the local printer -- does that mean deleting LPT1 as in
my batch file and then mapping it again?

Here are the results of "net use lpt1:".

Local name LPT1
Remote name \\FMHSc1\HthPsy01
Resource type Print
Status OK
# Opens 0
# Connections 2
The command completed successfully.

Looks OK, doesn't it? Everything seems to work except the actual
printing. Do you think an error in the printer or queue setup could
be the problem? It would have to be something that discriminates
between MS Word (it works OK and I guess other Windows apps do also)
and any form of DOS printing.

By the way, I am just a user with no supervisor privileges. There are
technical people who help with problems, but they aren't familiar with
DOS.

Thanks very much for your help,
Nick Hawthorn nhn at hpc2 dot auckland dot ac dot nz
 
I'm thinking that your DOS program may be having trouble
printing to that fancy printer you've got. The only thing
that I can think of to try is to use a HP LaserJet 4
driver. Create a "local" HP LaserJet 4 printer printing to
the LPT1: port that we just successfully mapped. That
might solve the problem.

Good Luck!
 
I'm thinking that your DOS program may be having trouble
printing to that fancy printer you've got. The only thing
that I can think of to try is to use a HP LaserJet 4
driver. Create a "local" HP LaserJet 4 printer printing to
the LPT1: port that we just successfully mapped. That
might solve the problem.

Thanks, but no thanks. Most printers can act like the very simple
printer that DOS knows about. I'll leave this problem for a little
while. Thanks for all your help, just sorry we haven't solved the
problem.

Nick Hawthorn nhn at hpc2 dot auckland dot ac dot nz
 
Back
Top