Windows XP Cookbook (Cookbooks)
Problem
You need to print from DOS or command-line programs but have a USB printer. Solution
Using a graphical user interface
Using a command-line interface
Use the following command: > net use lpt1: \\localhost\<printername> /persistent:yes where <printername> is the name you gave the printer share in step 3 above. Then run the following command: > dir > lpt1: This will print out a list of your current directory. When you need to print from a DOS program, make sure the program is set to use LPT1 so the printed output will go through the LPT1 port assignment to the newly shared USB printer. Discussion
DOS is not aware of and does not support USB devices. To print from a DOS program using a USB printer you have to fool XP into thinking it's sharing a local printer and capture all print data sent to that local printer as if it had an LPT-attached device. The NET USE solution is a simple, eloquent workaround to bridge old technology to new. See Also
HP has lots of information available at h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl11166. |