Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Generic User Avatar

MS DOS Print Redirection to Windows


  • Please log in to reply
15 replies to this topic

#1 ataro

ataro

  •  Avatar image
  • Members
  • 6 posts
  • OFFLINE
  •  
  • Local time:08:40 AM

Posted 09 February 2022 - 07:47 AM

I have a legacy system running on DOS, printer is not working. So I need to redirect LPT port from DOS system to another Windows 10 system. LPT port of DOS system will go as an input (COM) port to Windows 10. In this case how can I collect the print from DOS PC on Windows? DOS is printing text files only. What application do I need to use on Windows 10.



BC AdBot (Login to Remove)

 


#2 mPisano

mPisano

  •  Avatar image
  • Members
  • 212 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Long Island, NY
  • Local time:01:40 AM

Posted 09 February 2022 - 09:10 AM

You should add a Generic Text Only printer on the machine that the printer is attached to on the correct port and Share it with a short name ie "DOSPRINT" (confirm it prints locally)

 

On machine 2 I would add the printer from \\MACHINE1\DOSPRINT and confirm it prints remotely

 

To redirect DOS you need the "NET USE" command:

 

You can either create a small batch file and call both

 

NET USE LPT1 \\MACHINE1\DOSPRINT

Program.exe

NET USE LPT1 /DELETE

 

or create a persistent connection (You can also add user and password info if needed)

 

Start - Run - CMD

NET USE LPT1 \\MACHINE1\DOSPRINT  /PERSISTENT 

 
Keep in mind some older DOS software might open the LPT port when the software is launched and not close the port in between jobs. Window will eventfully spool the job after a delay. You can play with the spooler settings on the other machine. 
 
HTH,
Mike Pisano


#3 ataro

ataro
  • Topic Starter

  •  Avatar image
  • Members
  • 6 posts
  • OFFLINE
  •  
  • Local time:08:40 AM

Posted 10 February 2022 - 08:17 AM

MS DOS systems is not on the network, in this case how can I map the LPT port of DOS machine on Windows system?



#4 mPisano

mPisano

  •  Avatar image
  • Members
  • 212 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Long Island, NY
  • Local time:01:40 AM

Posted 10 February 2022 - 08:40 AM

it would be the same except an internal or localhost redirect 

 

So still share the printer on the machine, and then NET USE LPT1 \\127.0.0.1\DOSPRINT

 

Also - If you Motherboard has a Physical LPT1 port (ie 24 pin connector) then you need to either disable it in the BIOS or within device manager. Windows cannot map a virtual LPT port over physical hardware.

 

HTH,

Mike



#5 ataro

ataro
  • Topic Starter

  •  Avatar image
  • Members
  • 6 posts
  • OFFLINE
  •  
  • Local time:08:40 AM

Posted 10 February 2022 - 09:16 AM

Could you give me the DOS command to share the printer? It's a legacy system (to be replaced soon), printer is broken so setting up new printer is ruled out.


Edited by ataro, 10 February 2022 - 09:30 AM.


#6 mPisano

mPisano

  •  Avatar image
  • Members
  • 212 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Long Island, NY
  • Local time:01:40 AM

Posted 10 February 2022 - 09:58 AM

I'm a little lost... you started with

 

I have a legacy system running on DOS, printer is not working. So I need to redirect LPT port from DOS system to another Windows 10 system.

 

You then say:

 

MS DOS systems is not on the network:

 

I understand it's a legacy system... What did you have that broke, what OS are you on and what are you trying to hook up?

 

Mike



#7 mPisano

mPisano

  •  Avatar image
  • Members
  • 212 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Long Island, NY
  • Local time:01:40 AM

Posted 10 February 2022 - 11:45 AM

Also - you mentioned COM Port. If this is an older MSDOS machine see the MODE command

 

ie MODE LPTn[:]=COMm[:]

 

HTH,

Mike



#8 GNorman

GNorman

  •  Avatar image
  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:12:40 AM

Posted 10 February 2022 - 08:35 PM

LPT port of DOS system will go as an input (COM) port to Windows 10. 

 

To connect the LPT port of the plain DOS machine to the serial port of the Windows one you need a special cable, like the Photologic one ( http://www.photologic.ca/cap.html ) or similar. At that point, you also need software (like Hyperterminal) on the Win10 machine to listen at the serial port and flush the data on a file to be printed later on.
 
Most probably it's simpler to move the DOS program on the Windows machine and run it directly from there. If the Win10 machine is 64-bit you can still run DOS programs (16-bit) through the DOSBox emulator or a virtual machine.

Regards,
GN


#9 ataro

ataro
  • Topic Starter

  •  Avatar image
  • Members
  • 6 posts
  • OFFLINE
  •  
  • Local time:08:40 AM

Posted 11 February 2022 - 01:37 AM

Thank you very much Norman, this link is very useful for me.

 

On Windows 10 I will use Teraterm or Putty, is there any dependency on DOS OS for redirecting print from DOS to Windows 10?

 

Example When I connect MODEL CS-ZN from http://www.photologic.ca/cap.html, does DOS detect MODEL CS-ZN as a normal printer and print so that Windows 10 can capture using terminal application?



#10 mPisano

mPisano

  •  Avatar image
  • Members
  • 212 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Long Island, NY
  • Local time:01:40 AM

Posted 11 February 2022 - 08:27 AM

I think I finally understand the original question, by "redirect" you mean to literally connect

 

You can't attach a RS232 (9 or 25 pin MALE) to a LPT/Parallel 25pin FEMALE port. they are two different technologies.

https://en.wikipedia.org/wiki/Parallel_port

https://en.wikipedia.org/wiki/RS-232

 

RS232 PORTS are always MALE ports, LPT are FEMALE

 

You can connect LPT ports together which some legacy copy tools used, but not easily supported via DOS

 

You can connect RS232 together with a null modem or crossover cable. which is a easy solution!

 

https://www.neweggbusiness.com/product/product.aspx?item=9b-1y0-00de-00002

The above is a 9pin to 9pin wire, most older computers had 25 pin Serial ports so you man need below

https://www.neweggbusiness.com/product/product.aspx?item=9b-12-200-494

 

If you WIndows 10 machine does not have an RS232 port then I would use a USB adapter (also maybe with the above adapter)

https://www.neweggbusiness.com/product/product.aspx?item=9b-12-196-245

 

Then on the DOS machine redirect the port and open Putty\Hyperterm on Windows

MODE LPT1 = COM1

see https://ss64.com/nt/mode.html

 

 

Second Approach would be to use the DOS PRINT command and redirect the output to a FILE

https://www.computerhope.com/printhlp.htm

https://home.csulb.edu/~murdock/print.html

 

You can then copy it the file off the machine (3.5?)  or view it in DOS EDIT

 

Mike


Edited by mPisano, 11 February 2022 - 08:29 AM.


#11 ataro

ataro
  • Topic Starter

  •  Avatar image
  • Members
  • 6 posts
  • OFFLINE
  •  
  • Local time:08:40 AM

Posted 12 February 2022 - 03:50 AM

Normal cable connectors alone will work or we need the device intermediate devices like MODEL CS-ZN from http://www.photologic.ca/cap.html  ?



#12 mPisano

mPisano

  •  Avatar image
  • Members
  • 212 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Long Island, NY
  • Local time:01:40 AM

Posted 12 February 2022 - 04:41 PM

Connecting COM\RS232 ports is just a cable and hopefully the "MODE LPT1:=COM1" redirect works - worth a 10 dollar test!

 

The Cable should be Male to Male to fit the Female ports on both machines and should be labeled as NULL MODEM CABLE

Like:

https://www.cablestogo.com/product/52040/15ft-db9-f-f-serial-rs232-null-modem-cable-black

Make sure it's NOT a APW (all pins wired) or "Straight Thru", NULL Modem cables cross the TX and RX pins and sometimes also tie other pins together.

 

HTH,

Mike


Edited by mPisano, 13 February 2022 - 09:39 AM.


#13 mPisano

mPisano

  •  Avatar image
  • Members
  • 212 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Long Island, NY
  • Local time:01:40 AM

Posted 13 February 2022 - 10:33 AM

I did a little googling and found the old Print to File DOS TSR (Terminate stay resident) tool I used ages ago to capture LPT output to a file.

 

Just run "PRN2FILE C:\FileName.txt" Prior to running your software.

 

see prn2fil3.zip , Newer version of prn2file.zip both on

https://ftp.sunet.se/mirror/archive/ftp.sunet.se/pub/simtelnet/msdos/printer/

 

HTH,

Mike



#14 ataro

ataro
  • Topic Starter

  •  Avatar image
  • Members
  • 6 posts
  • OFFLINE
  •  
  • Local time:08:40 AM

Posted 16 February 2022 - 10:25 AM

 It's a custom hardware without USB port. I just need to print the output from DOS to another Windows machine. Eventually I will discard DOS machine.



#15 mPisano

mPisano

  •  Avatar image
  • Members
  • 212 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Long Island, NY
  • Local time:01:40 AM

Posted 16 February 2022 - 10:32 AM

What version of DOS and Does this custom hardware allow you to even get to a C:\ prompt?

Can you even add the "MODE LPT1:=COM1" to the Autoexec.bat file?






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users