Page 1 of 1

DOS printing in USB Printer Rate Topic: -----

#1 dineeshd  Icon User is offline

  • member icon

Reputation: 38
  • View blog
  • Posts: 619
  • Joined: 30-June 08

Posted 11 July 2008 - 02:29 AM

Today we are going to discuss about the traditional DOS printing methods in VB.Net. Over the years we had seen the developments of many advanced printers and printing methods, even then DOS printing is seems to be extensively used in the production environment. DOS printing is considered as very economical and user friendly comparing to the advanced printing methods, like Laser printers and inkjet printers.

For your better understanding let’s check out the basic DOS printing commands before going to the advanced methods. If you are using a dot matrix printer which is installed on your local system then the below code can be used for the printing. Here we are assuming that “printfile.txt” is the file, which we want to send to the local printer for printing.

type printfile.txt > LPT1:


If your printer is installed on a different computer in your LAN and its being shared to your local computer then you have to use the below printing command. Here we are assuming that “Computer2” is the computer name where your printer is installed and “NetworkPrinter” is the sharing name of that printer.

copy printfile.txt \\Computer2\NetworkPrinter


Even though we say DOS printing is really economical and user friendly, the quality of the output we cannot match with the Laser Printers or Inkjet printers. This fact forces most of the people to go for a Laser Printer or Inkjet Printer. This situation put the developers in trouble, because most of the latest Laser Printers and Inkjet printers, connecting using USB ports, and the above codes will not work with USB ports. So we need to have a different code or even different printer port to print to USB ports. Here we need to make certain changes to the printer settings before printing. You need to share your local printer, for example we will give the sharing name as “LocalPrinter” and the computer name as “Computer1”

Net Use LPT2: \\Computer1\LocalPrinter /PERSISTENT:YES


I used to do these coding in VB.Net, but it will work in almost all programming languages.

Hopping this may be helpful to some one…

Is This A Good Question/Topic? 1
  • +

Page 1 of 1