Friday, November 26, 2004

Printing from DOS Programs –– DOSPrint (version 2003.03.03) and PrintFile (version 2.1.5)

PrintFile
Screen Shots of PrintFile (click on the image to enlarge)

I found a recipe program that was once many years ago required to be purchased but was changed to freeware status. Even though the program is written entirely in DOS, I still liked it. Most versions of Windows still have the ability to open DOS programs. The program worked perfectly except I could not print from the program. I was able export a recipe to a file and print the file using another text program like Notepad, but it would not print using the print option directly from the program. When I looked at the printer setup in the program, I found I could select LPT1, LPT2 or LPT3 which I later discovered were called ports. I discovered my printer did not support this type of port but instead uses a USB port to connect the printer to the CPU. I performed searches on the internet to find a solution. In my searches, I discovered several forums where others reported the same problem while trying to print from legacy DOS programs but no solutions. I’ve thought about reviewing the recipe program (Meal Master) but since you can’t use a mouse with it, I decided most people may not like it. However, I do think some people may find my solution useful when printing from legacy DOS programs.

I tried PRN2FILE which is a DOS utility that redirects the printer output from the LPT port to a text file which I thought could be redirected to my USB printer. Unfortunately, I was never able to print from Meal Master to a text file with it. I decided to try something else. My searches eventually brought me to the DOSPrint web site, which said it could capture LPT1 through LPT9 directly to local LPT, USB, or TCP/IP printers. When I started using it though, I still had problems. When I selected something to print from Meal Master, the software for my printer would produce indications on my computer screen that it was printing but it would never actually print. I decided that DOSPrint must not be compatible with the software for my Canon Multipass printer. I found a solution by setting up a dummy printer that would use the print to file function available on Windows. So when I printed from Meal Master, it would save a file to a folder on my C drive. I then found another program called PrintFile that has a “spooling” function. It monitors the folder on my C drive for the file, prints it and then deletes the file. It may seem like a complicated solution but it works. I do recommend that you try DOSPrint and have it print directly to your printer first. If that doesn’t work, try my PrintFile spooling approach. I wrote a procedure on how to do this below:

1. Download DOSPrint and unzip its contents to a new folder called C:\Program Files\DOSPrint.
2. Create a shortcut with the target "C:\Program Files\DOSPrint\DOSPrintUI.exe" and name the shortcut “DOSPrint”.
3. Save the shortcut to your “Startup” menu which is most likely in the folder C:\Documents and Settings\All Users\Start Menu\Programs\Startup.
4. Determine the LPT number to which your legacy DOS program prints (or set it to LPT1).
5. Open DOSPrint by clicking on the Windows “Start” button, then “Programs” then “Startup” and then “DOSPrint”.
6. Highlight the LPT number to which your legacy DOS program prints.
7. Click on “Set” and select your printer from the list.
8. Try printing something from your legacy DOS program. If it prints, you are done. If it doesn’t, continue with the next step.
9. Add a new folder to your C drive, C:\spool
10. Add a new printer as follows:
a. Go to the Windows control panel and open the printers option. Click on “Add Printer”.
b. Click "Next" on the "Welcome to the Add Printer Wizard" dialog box.
c. Select "Local printer" and uncheck "Automatically detect and install...", click "Next".
d. Click "Create a new port", type has to be "Local Port" and click "Next".
e. Enter: C:\spool\dos.txt when prompted for port name, click "OK".
f. Select "Generic" from the "Manufacturers" and "Generic / Text Only" from "Printers", click “Next”.
g. The next dialog will prompt you for printer name and enter “DOS Printing”, select "No" to use this printer as default and click "Next".
h. In printer sharing dialog select "Do not share this printer" and click "Next".
i. Select "No" to print a test page and click "Next".
j. Click Finish.
11. Install PrintFile.
12. Set up PrintFile as shown in the screen shots above. In the “Settings” option, be sure that “Enable Spooler function” is checked. In the “Settings” option, click on “Conversion…” and ensure the option “Enable conversion of:” is unchecked.
13. Create a shortcut with the target "C:\Program Files\PrintFile\PRFILE32.EXE" /s:c:\spool\dos.txt (exactly like this with the quotes) and name the shortcut “PrintFile”.
14. Save the shortcut to your “Startup” menu.
15. Open DOSPrint.
16. Click on “Set” and then select “DOS Printing” from the list of printers.
17. Click on “OK”.

There are several settings in PrintFile that will change the appearance of your printed copies. You may want to read the help file that is downloaded with the program for assistance.


According to the documentation, DOSPrint requires Windows NT 4.0, 2000, or XP. Windows 9x is not supported. The file downloaded from DOSPrint is a compressed file, DOSPrint.zip. When unzipped, it produces 3 files DOSPrintUI.exe, DOSPrint.PDF, DOSPrint.exe that you save as identified in the directions.
The PrintFile documentation states it needs one of the following versions of Microsoft Windows, 3.1x, 95, 98, ME, NT 3.51 or later, 2000 or XP. The PrintFile download produces compressed file prf215.zip which when unzipped produces files PrFile32.exe, PrFile.exe and SETUP.EXE with some other text and help files. The download contains both 16 and 32 bit versions of the software. Double clicking on the SETUP.EXE with your file manager will result in the installation program choosing the correct executable for your operating system.

DOSPrint Home Page

Download DOSPrint

PrintFile Home Page

Download PrintFile

34 Comments:

At November 14, 2005, Anonymous Anonymous said...

Hi - this took a little bit of time to make work, but finally did. The instructions for DOSPrint weren't a whole lot of help either. Thanks Rod

 
At November 14, 2005, Blogger George said...

I'm glad you were able to use my review. This review represents several months of periodic experimenting. I finally figured out the combination of these two programs. Then after a couple of months, I decided to buy a recipe program. So, I am not using Meal Master anymore which is why I went through all this. I'm glad somebody got some benefit from it.

 
At August 28, 2006, Anonymous Anonymous said...

George, George, George... you are the greatest! I'm in love! If I weren't already a married woman... just kidding!

Yesterday, I pulled out my antique budget program on diskette from 1994 when my husband decided that he wanted us to get control of our budget. It all worked great until I wanted to print. I was able to use the "net use" command for one printer at work (although it had crap formatting). But, for the life of me, I couldn't get it to work from home. Your hard work and detailed instructions enabled me to print a beautifully formatted document of our monthly budget. Tomorrow I will be doing this setup again on my work laptop. Thanks so much!

 
At October 22, 2006, Anonymous Anonymous said...

George,

I followed your instructions for DOSPrint, rebooted, and lo and behold my ancient DOS application printed -- once. And then it stopped working until I rebooted once more. Any ideas on why this happened?

 
At October 23, 2006, Blogger George said...

I suggest that you verify that both DOSPrint and PrintFile are running when you reboot (you should see an icon for each of them in your system tray if they are running). Both programs must be running for this process to work. You need to verify there is a shortcut for each program in your start-up option (Click on your Windows start button, then "All Programs" and then "Startup" to verify the shortcuts are there). If you have both shortcuts in your start-up, make sure each shortcut has the correct path to the executable.

There is a different way to get the shortcuts in your startup. It takes a little dexterity, but you can create the shortcut on your desktop and then drag the shortcut over to your Windoes Start button and hover over it, then hover over "All Programs" and then drop it into "Startup".

 
At November 01, 2006, Anonymous Anonymous said...

Hi,
when I add C:\spool\dos.txt as the port name, I get "Specified port cannot be added. The port already exists". Any ideas?
Robert

 
At November 01, 2006, Blogger George said...

Robert,

I was able to repeat the same problem that you had. I attempted to add a second port when I already had a local port named “C:\spool\dos.txt” and got the error message that you describe. You probably have already added the port without realizing it. Since you already have the port, I modified the procedure a bit for you to add the printer:

a. Go to the Windows control panel and open the printer option. Click on “Add Printer”.
b. Click "Next" on the "Welcome to the Add Printer Wizard" dialog box.
c. Select "Local printer" and uncheck "Automatically detect and install...", click "Next".
d. Select "Use the following port:".
e. From the pull down list to the right of "Use the following port:", select C:\spool\dos.txt (Local Port).
f. Select "Generic" from the "Manufacturers" and "Generic / Text Only" from "Printers", click “Next”. If you get a prompt asking you about the driver, select to use the existing one.
g. The next dialog will prompt you for printer name and enter “DOS Printing”, select "No" to use this printer as default and click "Next".
h. In printer sharing dialog select "Do not share this printer" and click "Next".
i. Select "No" to print a test page and click "Next".
j. Click Finish.

I had no particular reason to use "dos.txt". It worked but there are other ways to make it work. The "printer" I had you set up above doesn't actually print anything. It actually creates a text file of what you are printing from your dos application. It saves the file to C:\spool and names the file "dos.txt". So when I set up PrintFile, I made it look for that specific file name in the folder. I suppose *.txt would work although it would then print any txt file that might get added to the C:\spool folder. Once PrintFile has printed the txt file, it gets deleted automatically. I thought using "dos.txt" might be a little safer in case a txt file gets accidentally added to the folder, so the file won't get printed and deleted unless it is actually named "dos.txt".

Let me know if you get everything working. You might also let me know of ways to improve the procedure. I which I could have made it easier.

George

 
At December 06, 2006, Anonymous Anonymous said...

Hello George,
Thank you very much for your suggestions. Your procedure works fine for me, just need to use dosprint and nothing else and I was able to share a legacy dos program in my LAn and then print from it on any remote windows printer queue.
Thank a lot!

Rattala

 
At January 17, 2007, Anonymous Anonymous said...

Hi George,

I have tested your Dosprint and it works fine in Administrator mode.
But when I switch to power User, I could not get it printing.
Upon checking the dosprint icon where I attached LPT1 to my printer, I got access denied.
Any idea ?
Thanks

 
At January 17, 2007, Blogger George said...

In response to the questionthat was entered on Jan 17:

I have always used DOSPrint on a computer where I have administrator privileges. If you look at the PDF file that comes in the DOSPrint download, it states that DOSPrintUI will not work for local non-administrators.

You might try using the file DOSPrint.exe instead of DOSPrintUI.exe that is also included in the download. The PDF file does not say anything about requiring administrator privileges (although I not able to test this for sure). The directions say to “Copy DOSPrint.exe to the SYSTEM32 directory”. Then open Notepad (it should be in “Accessories” option in your Windows start menu. Copy the text below that starts with "@echo off" and paste it in Notepad. Then save the file and name it DOSPrint.bat (be sure it has bat as the extension). Then include this in your startup folder or you can start it by double clicking on it with your file manager. This will put the DOSPring icon in your system tray. Then you double click on the icon in your system tray and perform steps 6 and 7 above. That should get it.

@echo off
dosprint install
net start dosprint

 
At February 20, 2007, Anonymous Anonymous said...

thank you very much. very helpful tips.

but i have the same problems as barry.levitt@careersystemsintl.com.
my dos program just print one job and nothing else until i reboot. i think it does this because printfile delete dos.txt and the generic printer doesn't work anymore.
any ideas what to do?

 
At February 20, 2007, Blogger George said...

Martian,

Well I thought I solved Barry's problem but maybe I didn't after all. If everything worked correctly, you should have 2 new icons in your system tray when you boot up. When you hover over one of them with your mouse cursor, it should say "DOSPrint". The other should say "PrintFile Spooler - Default Settings - c:\spool\dos.txt" when you hover over it. But I take it from what you say that these two icons do appear in your system tray when you boot up.

About all I can think of is that maybe you are using a version Windows other than XP. However, it seems that if "Generic / Text Only" option is available, it should work. Since it worked once, I don’t see why it wouldn’t continue to work.

I am afraid all I can do is tell you conceptually what is supposed to happen throughout the process. The first thing that you do is to select something to print in your DOS application. Let's say it prints to LPT1. DOSPrint captures the output of LPT1 and sends it to “DOS Printing” which is the generic printer you set up in Windows. “DOS Printing” doesn't actually print anything but Windows takes the output from DOSPrint and converts it to a text file. It saves the text as a file named "dos.txt" and saves it to the folder "C:\spool". This is where PrintFile takes over. PrintFile continuously monitors the folder "C:\spool" for the file named "dos.txt". If it finds the file, it prints the file to your printer and then deletes it. If you set PrintFile like I show in the screen shots, it also makes some minor changes when it prints (like changing the font to Lucida Console and adds page numbers to the footer etc.)

You might try monitoring the "C:\spool" folder when you print something to verify that the "dos.txt" file appears and then is deleted after it prints. If the file is not deleted, it might cause the problem that you are experiencing. It might also mess up if you try to print several different things in rapid succession. If you want to print in landscape format, you will need to set up PrintFile differently from what I show in the screen shot in the “Text File Settings” screen.

George

 
At February 21, 2007, Anonymous Anonymous said...

george, thanks for your quick answer.

you were right. i am using win 2k3 server but it also has an generic only text printer.

i manage to solve my problem by saving from my dos application a txt file and only PrintFile monitor the folder.

it s funny but it s working and i am half happy. thanks again. you have done an outstanding job with this tips. i was surprised to see that a "dosprint" program is around 14 $ to 90$ (i ve bought my laserjet with 100$ - new samsung :)) ).

thank you once again

 
At March 19, 2007, Anonymous Anonymous said...

Hi,
I'm getting the access denied message when logged on as a user, the same as anonymous posted on january 17, 2007. I'm using Dosprint.exe running as a service. It works fine when I'm logged in as administrator.

Any ideas ?
Thanks

 
At March 19, 2007, Blogger George said...

Hi,

I am writing this response to your posting dated March 19.

I posted a response on January 17 that should correct your problem that uses another program that is included in the DOSPrint download. I described a way to use it by creating a batch file using Notepad (go to your Windows Start>Programs>Accessories>Notepad). The only thing I didn't say was that you could save the batch file to your DOSPrint folder and then create a short cut to it which you would save to your start-up folder. The way I described was to save the batch file to your start up folder (which I think should work also).

Please post a reply as to whether this works or not. I'll post an update to my review if you do.

 
At March 29, 2007, Anonymous Anonymous said...

Dosprint problem is because there is a "dosprint" subfolder that gets created in the windows\system32 directory that the regular users have no access to. A file called spool1.spl needs to have access and cat get to. Change permissions on that folder to everyone, full control.

 
At September 08, 2007, Anonymous Anonymous said...

Hi - please help
When i tried to create new port in step 10e enter c:\spool\dos.txt there was an error message "specified port cannot be added. operation could not be completed"
Any ideas?

Thanks

 
At September 08, 2007, Blogger George said...

About the only thing I can suggest is to be sure you have created a folder in C:\spool and to be sure you are creating a new LOCAL port. Other that that, I am afraid I can't help. Sorry.

George

 
At November 04, 2007, Anonymous Anonymous said...

hi andreas from greece...

I can not understand in printfile step 13... please help me

 
At November 05, 2007, Blogger George said...

To create a shortcut, just right click on your desktop and select "New" and then "shortcut". The location of the item is:

"C:\Program Files\PrintFile\PRFILE32.EXE" /s:c:\spool\dos.txt

Click on "Next"
Enter "PrintFile" into the name field and then click on "Finish".

Once you have it on your desktop, just drag it into your Windows Start menu and drop it into your startup menu option which completes step 14.

 
At December 20, 2007, Blogger Yudi Lee said...

Hi, George
im running DOSPrint in user mode and im failed to set printer in step 6. then i tried what you suggest in your post at march 19, but nothing happen. I try to run DOSPrint in command line and i get this message when i typed DOSPrint Install : Cannot Open Service Manager Error[5] Unable to redirect.

Have any ideas?
Please give me some solution

 
At June 14, 2008, Anonymous Anonymous said...

Christ Greece
I think you've done a great job. The problem i have is that i cannot print in Greek (code page 737). Is there a solution for that ?

 
At July 20, 2008, Anonymous Anonymous said...

Hi George,
Currently I'm using this DOSPrintUI.exe for my Foxpro program. But my office is going to implement Active Directory, after I log in to the AD domain, I'm no longer have the administrator access to my PC, thus I couldn't use the DOSPrint. Do you have any idea/solution for this ? TQ. LPY.

 
At December 24, 2008, Blogger FAHAD AHSAN said...

hi,,

if I dont use dosprintui.exe in startup, i get error as ERROR term/o print error in my DOS programe,
before use dosprintui,, it was not the same,

Can you help me out,, I dont want this error message if I dont use dosprintui.exe in startup,

thanks,

FRAD

 
At May 05, 2009, Anonymous Zia said...

Thanks You Very Much George...Its Working...Great Job Keep it up

 
At May 27, 2009, Blogger Unknown said...

Hi,

thanks for this article but I have some problem. When I use DOSPrint with administrator privilages the program (from I wish to print) tells: Printer is offline and nothing happend and if I use it in normal privilages program doesn't tell: Printer is offline but nothing happend too. I'm Vista user.

I have used Printfil since now, but I can use it only for 30 days demo and then they want lot of money, but that program works.

Please help.

Thanks

Martin

 
At May 27, 2009, Blogger Unknown said...

Hi,

It's me, Martin, again. The program that I use can print to file so I had an idea to use only PrintFile with it. It works - prints but it print only if I close the program. It's accountant program and this will make my work very longer. Any idea how to tell PrintFile to print the file immediately to print? Because the file will appear when I "print to file".

Thanks for answer on both of my questions.

 
At May 27, 2009, Blogger George said...

Martin,

If your legacy program prints to file, just tell it to save the file as "dos.txt" in the folder "C:\spool". The PrintFile program continuously monitors the "C:\spool" folder for any text files that appear there. Once PrintFile sees the text file, it will print it and then delete the file, making the folder ready for whatever you print next.

I think this should work, let me know if it does.

I am afraid I know nothing about Vista, so unfortunately I have no answer to your previous question.

George

 
At May 28, 2009, Blogger Unknown said...

George,

I wrote PrintFile print that file which program "printed" only if I close this program and if I "print" for example 2 files, the original is rewrite and lost, so PrintFile print only the second file :(

I really don't know what is wrong.

Thanks a lot for helping me.

Martin

 
At May 28, 2009, Anonymous Rajeev from India said...

Dear George

I just bought a Samsung ALL in One laser SCX-4521F which has a parallel port with a view that it will print from my Dbase4 program but it is not. In fact it is not sending any print command from DOS. I work under Windows XP Stand Alone system. Can you suggest how can I make this printer work for me. Please help as I have already wasted my money previously on a HP Laser 1006 USB printer as well.

 
At May 28, 2009, Blogger Yudi Lee said...

Hi, i have alreadry try DOSPrint and Print file to print from dos program but after trying for a week i surrender. and i'm trying another method that windows provide to us. I'm using windows default command net use using command prompt.
You may try it and i'm sure it can provide solution for you. try using net use /? to show help about net use command. make sure you printer already added and shared on another computer. If you have another question you may ask me

 
At November 06, 2009, Anonymous Peter Stock said...

hi, i just installed the dosprint service. i have 2 printers i wish to print to, firstly an oki laser c3300 and secondly an officegjet g85. The office jet g85 prints fine from the dos application but the oki laser just shows an orange error light. any ideas?

 
At April 22, 2010, Anonymous Anonymous said...

Hi, I have tried to download DOSprint but the file is no longer available from there web site. Could you post another link to download this file from please.

 
At April 23, 2010, Blogger George said...

I fixed the link. I'm not sure how long it will work. It looks like the creator of the software may stop providing it as freeware. The link works for now though.

 

Post a Comment

<< Home