Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,129 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,005 people online right now. Registration is fast and FREE... Join Now!




DOS printing in USB Printer

 
Reply to this topicStart new topic

> DOS printing in USB Printer

dineeshd
Group Icon



post 11 Jul, 2008 - 01:29 AM
Post #1


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.

CODE
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.

CODE
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”

CODE
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…

Go to the top of the page
+Quote Post


Register to Make This Ad Go Away!


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 11/21/08 11:49AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month