How to Print to Network Printer from MS-DOS-Based Programs

Last reviewed: October 20, 1997
Article ID: Q154498
The information in this article applies to:
  • Microsoft Windows NT operating system version 3.1
  • Microsoft Windows NT Advanced Server version 3.1
  • Microsoft Windows NT Workstation versions 3.5, 3.51, and 4.0
  • Microsoft Windows NT Server versions 3.5, 3.51, and 4.0

SUMMARY

This article describes how to print to a network printer from an MS-DOS- based program in Windows NT. By default, most MS-DOS-based programs print directly to either LPT1 or LPT2. However, the output is not automatically routed across a redirector to a print share unless you use one of the following methods.

MORE INFORMATION

Method 1

Establish a persistent connection using NET.EXE. To do so, use the following syntax at a command prompt:

   net use lpt<x>: \\<printserver>\<sharename> /persistent:yes

Method 2

Print directly to the printer share by using the following syntax at a command prompt:

   print /d:\\<printserver>\<sharename> <drive>:\<path>\<filename>

MORE INFORMATION

When printing to a Novell Netware 3.12 printer queue, use the following syntax:

   net use lpt<x> \\server\queue

If the LPT port is redirected successfully, the following message should appear:

   The command completed successfully

To disconnect persistent LPTx connections, use the following syntax:

   net use lpt<x> /delete

Netware is manufactured by Novell, Inc., a vendor independent of Microsoft; we make no warranty, implied or otherwise, regarding this product's performance or reliability.


Additional query words: prodnt 3.10 3.50 3.51 4.00 capture port LPT1 LPT2
LPT3
Keywords : nthowto ntprint kbenv kbprint
Version : WinNT:3.1,3.5,3.51,4.0
Platform : winnt
Issue type : kbref


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.