Dos printing on Terminal Server 2008 32Bit

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.
ACOMAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rindiCommented:
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/
ACOMAuthor Commented:
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.
rindiCommented:
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

Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

Don ThomsonCommented:
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
ACOMAuthor Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ACOMAuthor Commented:
We did try a lot of solutions and tools, but this is the best way so far.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.