Printing to USB printer from old DOS app that only knows about LPT1

Hi,

Windows 2000 Pro, local USB printer (HP DeskJet), and old DOS app that only prints to LPT1.

Now, I read somewhere some time ago, that the workaround is to share the printer, then capture the shared printer to LPT1. I think I even made it work that way once.

But, this time it did not work!?

I did following:

net use lpt1 \\pcname\\printername /persistent:yes

captured sucessfully.

then tried to print:

dir > lpt1 (in the directory that had more then one page worth of files)

did not work.

restarted the computer

net use

lpt1 shows as being there, but still no printing.

Anyone has any ideas how to make this work? I need to make this work over the phone tomorrow, but I'm running out of ideas.

Thanks
LVL 4
astankovicAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Luc FrankenEMEA Server EngineerCommented:
Hi astankovic,

net use lpt1 \\pcname\\printername /persistent:yes
should be net use lpt: \\pcname\\printername /persistent:yes



Greetings,

LucF
astankovicAuthor Commented:
> net use lpt1 \\pcname\\printername /persistent:yes

this is a typo, i did not use double black slashes after computer name
Luc FrankenEMEA Server EngineerCommented:
oops, mistake, should be: net use lpt2: \\pcname\printername /persistent:yes
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

Luc FrankenEMEA Server EngineerCommented:
another mistake from my side :-( it's getting late here.

net use lpt: \\pcname\printername /persistent:yes
astankovicAuthor Commented:
LucF,

why lpt: instead of lpt1? Can you explain a bit? I've never seen this before.
Fatal_ExceptionSystems EngineerCommented:
LucF, you are a riot.  All that TS got to you today, eh?  BrainBurn.  :)

FE
Luc FrankenEMEA Server EngineerCommented:
Sort of... yes... Need some sleep... going to take it soon...
Luc FrankenEMEA Server EngineerCommented:
>why lpt: instead of lpt1? Can you explain a bit? I've never seen this before.
lpt1 is not a device, lpt: or lpt1: is a device, so your application knows what to look for.
Luc FrankenEMEA Server EngineerCommented:
>then tried to print:
>dir > lpt1 (in the directory that had more then one page worth of files)
>did not work.

try dir > lpt: and it should work if the port is captured the right way.
Luc FrankenEMEA Server EngineerCommented:
Good morning, just had some sleep and arrived at my job. Just taken a look at the script I use here.

This is the one I use:
NET USE LPT1: \\<servername>\<printername> /PERSISTENT:YES

And it does the job for me.

If the usb printer is on the same computer, try:

NET USE LPT1: \\localhost\<printername> /PERSISTENT:YES
or: NET USE LPT1: \\127.0.0.1\<printername> /PERSISTENT:YES

I also assumed that you knew that you have to share the printer to be able to capture it this way, and that you have to use the sharename in the NET USE line.

Greetings,

LucF

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Fatal_ExceptionSystems EngineerCommented:
Way to Go!   LucF  :)
Luc FrankenEMEA Server EngineerCommented:
Glad to help. I have to say, I had to check it myself, it's a long time ago I was having the same problem.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 2000

From novice to tech pro — start learning today.