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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing directly to a printer on a USB port 2

Status
Not open for further replies.

walter2241

Programmer
Feb 10, 2009
2
US
I am writing VB code to access the printer directly with statements such as
Open "LPT1" for output as #1
Print #1, "Message line to printer"
Close #1

This code worked OK for a printer on LPT1. Now I need to address a printer on one of several USB ports. Also need control codes for my Lexmark printer.
 
Can't you "capture" the printer's port ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I need to know the "port name" for a USB port, similar to LPT1 a serial port
 
The Open command cannot address USB ports, it can only open LPT and COM ports.
What you need to do is share your printer and then capture LPT1 to the shared printer, at a DOS prompt you enter
Code:
NET USE LPT1 \\computer\printer


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top