Monday, November 26, 2007

How To Print to Network Printer from an MS-DOS-Based Program.

How To Print to Network Printer from an MS-DOS-Based Program.

We can use the net.exe command to establish a persistent connection.To do that just following syntax at a command prompt

net use lptx \\printserver\sharename /persistent:yes

x is the number of the printer port that you want to map, where printserver is the print server sharing the printer, and where sharename is the name of the printer share.

In this example we to map LPT3 to a printer shared as Laser1 on a print server named Boss, follow these steps

Click Start, and then click Run.

In the Open box, type cmd, and then click OK.

Type net use lpt3 \\pserver\laser1 /Boss:yes, and then press Enter.

To quit the command prompt, type exit, and then press ENTER or click close button x.

1 comment:

Unknown said...

This method works only if the destination printer is DOS compatible. If you need to print to a Windows-Only (GDI) printer, please see: How to print from DOS to Windows-Only printers