0

I have a legacy app which uses IPX/SP for networking and is a 16-bit DOS application. No access to source code, cannot change anything. The only way I can run it is under Windows XP.

Trying to automate some processes, and need to redirect what the app is printing to text files. The app prints to 3 different printers, LPT1, LPT2, LPT3 depending on the type of content.

Attempted to use the old utility "prn2file", but does not work. It registers alright with

    prn2file "c:\temp\file1.txt" /p lpt2

and states that it is redirecting LPT2 to c:\temp\file1.txt. It does create the file but it remains empty no matter what I print. I cannot even get it to print from a DOS command prompt, it says "cannot initialize PRN".

So I heard that PRN2FILE may no longer work in recent versions of Windows. No exact data what "recent" means, but anyway. So I tried a trial from "printfil.com" which says they handle this problem. But the same happens - nothing. Never prints. Not even from the command prompt. Their support is very helpful and gave lots of suggestions, but it just doesn't work.

Tried 3 different computers with Windows XP, tried in a VM, same result. Little bit mystified as to what is going on here.

That seems to be a real easy problem but how come it never works? Anyone have another option which provenly works?

1 Answer 1

2

This old procedure to create an file-only printer might work in XP:

  • Go to the Printers folder and select Add Printer

  • Choose "Local printer"

  • When selecting a port, check the box next to "File - print to file"

  • Set "Generic" under "Manufacturer" and select "Generic / Text only" on the right

  • Name the printer (fileprinter for example)

  • Finish the installation.

  • Capture LPT1 to "trick" the DOS application:

      net use lpt1 \\localpcname\fileprinter
    

Now if you print in the DOS app, a window should appear where you can enter the path and file-name of where the print output should go.

3
  • Thank you - this works!
    – nepdev
    Commented Apr 3, 2021 at 18:33
  • Maybe I was not so specific - but I want to automate things so don't want any windows popping up to enter path and file name. Changed your instruction a bit - instead of selecting the FILE port, we select the option CREATE A NEW PORT and simply type a path and file name. The rest is the same - then it sends the print job to that same file always without user intervention. But majorly this is what you wrote.
    – nepdev
    Commented Apr 3, 2021 at 18:35
  • To add the credit - found the file name port trick here - docs.microsoft.com/en-us/troubleshoot/windows-server/printing/…
    – nepdev
    Commented Apr 3, 2021 at 18:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .