Solved

Dos printing on Terminal Server 2008 32Bit

Posted on 2012-04-05
6
2,025 Views
Last Modified: 2012-04-10
I have windows server 2008 R1 32 bit installed in a virual machine with the terminal services role installed.  My goal is to get our old 16 bit dos program to run in TS.

What isn't working is the "not regular" printing, and by that I mean our 16 bit dos program which prints directly to an LPT port is not noticing the mapped lpt port.  I have a batch file  which maps two network drives needed to run the dos program, maps lpt1 to a network printer, and then starts the dos program.  All of those mappings complete successfully and the program runs fine.

However anytime I print from our program, it complains 'printer not ready', which is an error we see around here when the lpt1 port is not mapped correctly.

If i do a c:\dir > LPT1 it prints without a problem
 
Is there anything I can do to make this program be able to print using terminal services that any of you know of?
Thanks.
0
Comment
Question by:ACOM
  • 3
  • 2
6 Comments
 
LVL 88

Expert Comment

by:rindi
ID: 37810221
I've been able to get DOS programs to print to LPT ports (whether Physical or mapped) using the Megabuild version of DOSBox. Just start your DOS application from within the DOS Box app. There are config files which you can adapt to your needs and plenty of help files:

http://home.arcor.de/h-a-l-9000/

Below is also the link to the official "DOSBox" site, but with that one I wasn't able to get printing working, but it's forums and tutorial can still help getting it setup:

http://www.dosbox.com/
0
 

Author Comment

by:ACOM
ID: 37810801
Thx for your answer.

But there is an extra catch:

Depending on where the users log in, they need to get different lpt mappings, depending on location. This needs to be an automatic process. Right now when the user logs in on the terminal server, a script checks on which pc this is and maps the lpt1 - 3 accordingly.

I think working with dosbox will get things far more complicated to do this...  

Strange thing is, it does work without any problem on windows7 32 bit, the problem is only in  TS2008.
0
 
LVL 88

Expert Comment

by:rindi
ID: 37811794
I used DOSBox on a customer's PC's because his issue was that the Clipper based DOS tool he is using will crash on new PC's because those PC's are just too fast. As DOSbox is like a PC emulation you can tell it at what speed it should run, so it emulates an old IBM XT PC or similar (they ran at something like 8MHz or less if I remember correctly). So with DOSbox the tool ran without issue. As I also needed to get it to print I used the Megabuild version and started it using a batch file where the LPT ports are being mapped to the Printer. I think you could probably either use your script to start the correct batch file based on the location, or probably even directly start it using your script. Below is an example:

@echo off
net use lpt2 /delete
net use lpt3 /delete
net use lpt2 \\IPAdress\PrinterName
rem net use lpt3 \\IPAdress\PrinterName
"C:\Program Files (x86)\DOSBox_MB6\dosbox.exe" -noconsole -conf D:\Users\Public\Documents\DOS\Clipper\clipper.conf 
exit

Open in new window

0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 14

Expert Comment

by:Don Thomson
ID: 37811923
You mentioned that you can print to the mapped printer using for instance  dir c:\  > lpt1  it works
If that works then using something like copy mytextfile.txt ltp1  should work as well

If you can get your Dos program to print to a file - then copy the file to the appropriate printer -
You would have to put the saved file in a specific folder - and run a looped batch file to copy them to the printer and then either rename and file them or delete the file itself. If you put a loop that checked say - every 5-10 sec  you shouldn't have any over writes.

Something to look at
0
 

Accepted Solution

by:
ACOM earned 0 total points
ID: 37812029
We found a Solution.

There is a little free program called DOSprint:
http://www.andtechnologies.com/index.php?q=downloads/free-software

When you install and lauch it, it creates a tray icon. If you configure it you can choose which lpt1 - 9 port you want to map with the available printers.

A colleague of me created a VBScript that checks on the local computername and edits the register keys and thus the mappings of DOSprint depending on that name.

I attached the script.

Thx everyone for the help!
Printscript.vbs
0
 

Author Closing Comment

by:ACOM
ID: 37826759
We did try a lot of solutions and tools, but this is the best way so far.
0

Featured Post

Do email signature updates give you a headache?

Are you constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had a question today where the user wanted to know how to delete an SSL Certificate, so I thought that I would quickly add this How to! Article for your reference. WHY WOULD YOU WANT TO DELETE A CERTIFICATE? 1. If an incorrect certificate was …
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now