Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Dos printing on Terminal Server 2008 32Bit

Posted on 2012-04-05
6
Medium Priority
?
2,104 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…

610 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