No announcement yet.


  • Filter
  • Time
  • Show
Clear All
new posts

  • printing

    Is it possible to print to a windows network printer from DOS

    I'm running my Dos applications in a Dos box on Windows 2000


  • #2
    the only option that I know of for a DOS program to print to a
    Windows printer whether it be local or network would be to use
    a program called DOSPRINT. There should be a full working download

    Lance, could give many more details and answer any questions.


    Gary Stout
    [email protected]
    Gary Stout
    gary at sce4u dot com


    • #3
      Lance's DOSPRINT is a commercial program. The download available
      at the url that Gary provided is fully functional, but writes
      "Sample" across the printed page. This lets you try-before-you-buy.

      I am, myself, a licensed user of both of Lance's libraries
      (DOSPRINT for DOS, and DLLPRINT for 32-bit apps). I wholeheartedly
      recommend them. Lance's DOSPRINT will let you print to virtually
      any Windows printer from within a DOS program, using the DOS
      compiler's "SHELL" command. I myself run 3 simultaneous printers:
      one is a 24-pin dotmatrix on LPT2, one is an HP DeskJet 682C
      on LPT1, and one is an HP DeskJet 812C on USB. Lance's DOSPRINT
      works fine on all of them. Lance's libraries work by using
      Epson ESC printer codes, which you put in the files to be printed.
      This should not be a problem, as you can read in the original file, add
      the ESC codes, and print it back out to a second, temporary file.
      That way, your original file is left intact, while you can print from
      the secondary file. Lance's libraries then read in the file and translates
      the ESC codes so they can be used by the Windows driver for the
      printer you want to print to.

      I consider the purchase of both of Lance's printing libraries to be
      well worth the cost.

      Don Dickinson also has a printing library available, but his is strictly
      for 32-bit apps. However, if you have both a 32-bit PB compiler, and
      the PB DOS compiler, a little ingenuity will let you use his library,
      also. I am also a licensed user of Don's library.

      Don's library and Lance's libraries are all STELLAR performers.
      If I hadn't purchased them, it would have meant MANY hours of my
      having to learn how to use the Windows printing API, which I understand to be
      quite labyrinthic. So, thanks to Lance and Don, I was able to
      devote my energies to other, more important programming endeavors.

      Lance, Don, care to add anything?


      Clay C. Clear
      mailto:[email protected][email protected]</A>


      • #4
        Originally posted by Steve Bouffe:
        Is it possible to print to a windows network printer from DOS


        The DOS program needs to see the printer on an LPT Port or COM
        Port. So all you need to do is "MAP" the network printer to a local
        port. This can be done by right clicking on the network printer
        icon on the context menus, or you can type in the following command
        from the DOS Box's Prompt:

        NET USE [Port Name eg. LPT1]: [Resource Name]

        so if my printer was called Prin1 and on a machine called Mach1 and I
        wanted to map that printer to LPT1 i would use the following:

        NET USE LPT1: \\Mach1\Prin1

        This will allow your DOS program to print to the printer named Prin1
        on the computer Mach1 by printint to LPT1. Hope this helps...

        Scott Slater
        Summit Computer Networks
        Scott Slater
        Summit Computer Networks, Inc.


        • #5

          Scott's reply should work fine as long as the network printer
          is not a "windows only" printer. If it is a dot matrix or something
          DOS compatible, you should be fine.... otherwise, you will need
          the something to intercept and translate into ESC codes that the
          printer can use.


          Gary Stout
          [email protected]
          Gary Stout
          gary at sce4u dot com


          • #6
            Thanks for the plug, Clay! You covered the bases pretty well there, so I only have a little to add:
            • DOSPRINT can use any printer that has a driver installed, be it parallel, USB, serial, network, etc.
            • DOSPRINT and DLLPRINT share a common print engine (and an optional print preview!) so if you eventually port your DOS code across to Windows, you can virtually leave the DOS printing code intact and concentrate on other aspects of your app development.
            • DOSPRINT can print 6 different image formats, plus shaded boxes, page border, and font flexibility, and a whole heap more functions... see for a fully-functional demo.

            I hope this helps!

            Lance Edmonds

            mailto:[email protected]