Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing from DOS in Windows XP

Status
Not open for further replies.

asotmhg

Programmer
May 11, 2000
48
US
I am printing from dbase IV for DOS to a Lexmark X215. When I print a report the printer displays 'Printing...' and then the message goes away without anything printing. Dbase IV doesn't have the Lexmark driver. Which one of these is the problem?

* Incorrect printer driver
* Printing in DOS with XP
* Lexmark X215 doesn't support DOS printing

Is the report making it to the printer and then fails because the driver is incorrect? Is the printer seeing the report, but can't print it because it is from DOS? Is there a general problem with printing from DOS on XP that is causing the problem?
 
Perhaps you can print to "file" first e.g "post script"
and send the files to the printer later.
 
Share your Printer as if you were going to share it accross a network.

Open a command prompt and type

NET USE LPT2: \\computer name\share name of printer

Where computer name is the name of your computer and Share name of printer is the name you shared the printer as.

Now when you print from your dos program print on port LPT2

This should then allow you to print.

Greg Palmer

----------------------------------------
Any feed back is appreciated.
 
One other thing is make sure your share name is 8 characters or less.

Greg Palmer

----------------------------------------
Any feed back is appreciated.
 
Two Questions:

I know how to get it to print a text file and I know I can drag and drop it onto a printer to print the file, but how could I automate the process of printing the text file without having to drag and drop the text file onto the printer?

If I use the NET use option will a windows driver be used? How often do I need to run the command? Every time the PC boots, before the DOS program runs, etc..
 
The Net Use command would only need to be run once.

It will use the drivers that are already installed.

To print a txt file from dos try typing the following at a dos prompt. It assumes you have done what i suggested in my first post.

Type c:\filename.txt > lpt2

change filename to whatever the file name is.

Greg Palmer

----------------------------------------
Any feed back is appreciated.
 
Put it in the login script on the logon server.
or put it in a batch file placed under "all users" "startup" folder.
 
I used the Net USe command and LPT3 port. I get the same thing. I was told by Lexmark that I will have to use the windows driver to print to the printer.

How can I setup a print que to print the text files using a windows driver? Basically, how can I let the report be generated as a text or post script file and it be automatically printed without having to drag and drop the file onto a printer?
 
You really should not have to use the option to "print to a file."

1. Clear all existing printer defintions for this printer. Start Button, Printers and Faxes, File, Printer Server, and remove the existing definitions.

2. Set up a new "Local" printer definition, and let it install the printer as a local device.

3. Create a new "Network" printer, and point to the local printer.

4. As Greg Palmer mentioned, then use in a batch file or whatever a NET USE statement to do the printer redirection to the "Network" printer:

Net use lpt2: \\printer_server\printer_sharename /Persistant:Yes

5. Tell your application to print to lpt2.
 
I set up a local printer and then shared it with the name LX215. I then used the Net use command and LPT3.

Net Use Lpt3: \\computername\sharename /persistent:yes

I then went into dbase IV and told the printer to print to LPT3. The printer display read 'printing...' and then the display went back to ready with no printing taking place. Am I doing something wrong?

 
Good. You have the printer redirected enough to make Dbase happy, you do not have to deal with print to files, and the only thing left is to convince the Windows print que that your are done.

1. In the (right-click) properties for the "Network" printer, Advanced, be certain that it is set to "Start printing after the last page is spooled." And that under Port settings, Configure Advanced Settings, you give a reasonable timeout.

2. If you have control over the DBIV program:

;;; open the printer queues for output

set print to \\server\printer=lpt3

(obviously, you subsitute for the printer path above)

;;; Now do your report or print statements

(Insert printing here)

;;; tell Windows the job is done
set print to

;;; remember to re-intialize print redirection every time

 
1. I have now set the printer driver in Windows XP to 'Start Printing after the last page is spooled." The timeout settings on the port are set to 90.

2. How do I do your second part? I am going into the dbsetup and changing the configuration. I go into drivers and setup a printer name, driver and device. The device is LPT3. I save the configuration and go into dbaseIV. I choose a report and select the printer that I setup for the report. I choose print report. What I think I am doing wrong is the 'set print to ' parts.

I really appreciate your help.
 
If you cannot see the code from Dbase IV, then my second part will not matter. It was unclear in your first instruction whether this was an application you had written (and therefore could control absolutely) or an applicaton you are simply setting a port name with.

It appears the latter.

Add a third-party print manager for applications where you cannot unambiguously tell the Windows print spooler what is going on with a job.

Recommended:
If this is an application you purchased, or do not feel confortable, or able, to edit the source, use this modestly priced third party tool to handle the redirection issues with the Windows print spooler.
 
I have not written the application, but I do have access to the dbaseIV control center and all of the applications and reports are listed there. I was selecting a report from the control center and choosing 'modify report.' I then would select F10 and go to the printer menu where I would test print the report.
 
Still sounds good.

When you test print a report, does it appear? You can shorten the printer timeout if it takes too long, but does it appear?
 
When I test print the report the printer displays 'Printing...' and the printer in windows shows an entry that says 'spooling' and then 'printing', but it goes away very fast. Then the printer goes back to ready and nothing prints.
 
Use the Third-party utility I mentioned earler. One of the advantages that you cannot control is that its earlier notions of lpt1, lpt2, etc.. are too literal for XP.

My original instructions will work fine for pure dos devices under XP, and under lpt1 (for odd reasons) should work without issue under Dbase IV or Clipper apps. Once you stray in setting port assignements there could well be an issue.

So, revised advice.

. Keep the "double" printer mapping I recommended to begin with

. Leave the printer settings as to first or last page;


Try the assignment:

Net Use lpt1: \\printer_server\sharename /Peristant:Yes

Make the assignment, if possible, under your application:

. lpt1 (if not joy)
. enter prn as the device.

prn is the low-level DOS redirector to the defined printer device, and often solves odd printer problems.

If still no joy, use the Third-party utility.
 
Thanks for your help. The problem appears to be with the Lexmark X215 printer. Lets say that the PC with DbaseIV and the X215 is PC 'A' and there is another XP PC lets say PC 'B' and it has a HP1200 Laserjet. I can print to PC 'B' from PC 'A' and from PC 'B' to PC 'B' from DOS, but I can't print from PC 'A' to PC 'A' or from PC 'B' to PC 'A'. I can print from DOS to all printers except the Lexmark X215. I tried installing a different windows driver for the X215, but that doesn't work. It does the same thing. Thank You for your help.
 
This would have worked, but the Lexmark X215 is a Host based printer and will not support DOS printing at all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top