Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing on a USB-printer from DOS 1

Status
Not open for further replies.

6856

Programmer
Dec 24, 2003
2
BE
Big problem on a Windows-only printer, conected on USB.
Verry nice to work with this kind of printers if you'r using windows app.
Try to command this printer form a DOS-programm and problems begin.
The printers type and brand don't make a difference.
The problem can only be fixed, if the printer give's you two options to conect :"USB or parralel" Just connect parralel and you can use it true DOS-app.
Now, how about the others, witch don't give you a choice but to connect on USB...????
Anyone having this problem fixed ? I'd love to hear from you.
 
1. Share the printer. If you are not on a network, install the Microsoft Loopback Adapter and bind TCP/IP to it.
2. Due to an odd security quirk of XP, you may not be able to share it as LPT1 if you are a non-Administrator user unless you use Devcon.exe to remove the plug and play assignment on the lpt1 adapter:
In order to be able to use the command devcon disable *PNP0401 , you need Devcon.exe:

If your DOS program will print to lpt2, ignore this issue.

3. Now you can print from DOS:
 
With a network installed, just start with Step #3 above for a local or network printer use under DOS.
 
Thanks bcastner,

I'm looking for a solution, installable on every PC, running with an USB-only attached printer.
I'm trying to fix this problem, without having to explain each custumor how to install 'Loopback adapter' and/or how to manage Devcon.exe

The easyest way so far, is printing to a file and having it manualy print from within windows. (Of course this is not user-friendly just as it is, to advice them to buy a printer having the parralel-conection option.)

Thanks anyway, I'll try explaining these steps to custumors and hopefully I won't have to pay them a visit.

I do have to tell you, your solution realy works. So you have made me come closer to the final solution. Thank you verry much.




 
Most DOS programs allow a choice of lpt1, lpt2, etc. If you pick lpt2 you can ignore step #2 completely.

You can also email them a copy of devcon.exe (zip it so that there are no email issues) and a batch file:

open a notepad session, and copy and paste the below. Save it as dos_printer.cmd

**** start copy/paste below this line *********
@echo off
@echo Setting up your printer ....
devcon disable *PNP0401
rem add the computername and printer share name below
net use lpt1: \\computer_name\share_name /Persistent:Yes /y
****** end copy/paste above this line

Have them unpack devcon.exe into c:\windows so that it is always available.

Remember that if lpt2, lpt2 or somesuch is available as printer assignments under their DOS program, you do not have to mess around with Devcon.exe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top