# Printing from DOS



## bassetman (Jun 7, 2001)

I tried printing from DOS awhile back and printer just spit out a blank page.

The command I used was

Dir > lpt1

Did I get the command wrong, or do I have a driver problem in DOS?

Thanks


----------



## etaf (Oct 2, 2003)

any help
http://www.computerhope.com/printhlp.htm


----------



## Rockn (Jul 29, 2001)

It will only output to the LPT port if you phisically have a printer connected to it or you have your current printer set to capture the LPT port.


----------



## bassetman (Jun 7, 2001)

Thanks, wonder why it didn't work for me?


----------



## kiwiguy (Aug 17, 2003)

And your printer has to be capable of working in DOS.

Many printers are Windows only, and under DOS there is just no driver available.


----------



## bassetman (Jun 7, 2001)

Rockn said:


> It will only output to the LPT port if you phisically have a printer connected to it or you have your current printer set to capture the LPT port.


The printer is attached, and as I said it spit out a blank page, so it must see the printer?


----------



## kiwiguy (Aug 17, 2003)

Possibly, but not guaranteed.

Your DOS syntax looks OK, so the printer will see something coming at it. But if it requires a driver to code the data in order that it can understand it, and that driver only operates in Windows then a result is not guaranteed?

However, as it connects via the parallel port there is a better than average chance that it would work under DOS, but may still need the DOS driver?

What make and model of printer, what operating system?


----------



## bassetman (Jun 7, 2001)

kiwiguy said:


> Possibly, but not guaranteed.
> 
> Your DOS syntax looks OK, so the printer will see something coming at it. But if it requires a driver to code the data in order that it can understand it, and that driver only operates in Windows then a result is not guaranteed?
> 
> ...


Thanks! I thought it was probably a driver problem! 

Any advice?


----------



## Cosmic (May 5, 2003)

Dir > lpt1 Don't sound like what I used.

TREE A: > PRN (Should get you a listing of floppy A)

COPY xxxxxx.xxx > PRN (Prints that filename)

DIR > PRN

If you just want to check the printer is working, do a DIR on the screen and then press the Print Screen key. On some keyboards it might require Shift - Print Screen. Bout as simple as it is going to get.  

I don't understand this driver part. In Old DOS there is no driver. Each printer just had ESC codes for different functions. It varied between printers. So the software actually had to support the printer and use the correct ASCII value for the proper letter / command / etc. If anything is being sent to the printer, it should print something, might be garbage. Dunno, try a page of text. In some printers there is a conversion file to allow it to be used with DOS. Try looking in the printer manual.

When in doubt hook up an Old Printer.  

Ah, for the dazes when the Sun was warmer, everything worked and had a manual. The World started to go to Hell in New DOS and somehow morphed into XP.


----------



## Rockn (Jul 29, 2001)

You may also need to set your LPT port to a different mode in the BIOS for DOS printing to work.


----------



## bassetman (Jun 7, 2001)

I tried the copy afc.txt prn command from my options dir
the printer responded, but the paper jammed and no text on it. Then I notice it couldn't fint that file the second time!  I can't see it in a dir either  It does show in windows though? 

Any thoughts?


----------



## sekirt (Mar 28, 2003)

Hi bassetman and all,
Is this something just for personal satisfaction?
You could just open in Notepad and get it printed?

Or check out some related freeware/shareware/websites and see if that helps:

Free Raw Print 
http://www.freewareseek.com/utils/643/

Print File
http://www.lerup.com/printfile/

WordPerfect for DOS
http://64.233.167.104/search?q=cach...html+DOS+printing+freeware+"Windows+98"&hl=en

DOSPRN 1.77
http://www.dosprn.com/

sekirt


----------



## bassetman (Jun 7, 2001)

sekirt said:


> Hi bassetman and all,
> Is this something just for personal satisfaction?
> You could just open in Notepad and get it printed?
> 
> ...


It has become a matter of principle!


----------



## Bob Cerelli (Nov 3, 2002)

Another way to test is to use the DOS EDIT program. This is a DOS based text editor that will let you print to a LPT port. 

You might also check to see how LPT1 is configured in CMOS. 

But DIR > LPT1 should work fine and has been used for years.


----------



## bassetman (Jun 7, 2001)

How do I get/get into DOS EDIT? Just type it?

I'm still a little nervious in CMOS!


----------



## sekirt (Mar 28, 2003)

Where exactly are you getting the text you want printed?
If you are using Word Perfect for DOS (or some other program), you probably won't be given the chance to point the text to another program. It would either get printed directly from WP or it will have to be saved as a file. Then you can put it into another program. For help with the DOS EDIT program, type *EDIT/?* and press Enter.

Or are you generating the text yourself? The DOS option to be able to type like a typewriter won't allow the use of a program. That is, when you press a key, that letter will be printed. It slaves the printer to the screen. Not sure that this would ever work with a newer printer. Or are you using an older Dot Matrix or something? (to engage this, press CTRL+Print Screen) (At least that is how it used to be). Press same keys again to disengage.

Here is a MS article addressing DOS printing in XP, if that helps:
http://support.microsoft.com/kb/314073

sekirt


----------



## bassetman (Jun 7, 2001)

I am at a DOS prompmt from M$ DOS, and it is a C:\Windows or C:windows\options prompt that I have typed the command!


----------



## sekirt (Mar 28, 2003)

When you are at the DOS prompt...where is the text? Is it in a text file? 
If you want to try the EDIT program, type:
EDIT bassetman.txt and hit Enter.

Or have you tried the other programs I have listed in my previous post?

Or do you intend to start typing the text itself and want it to print as you type? I don't think you can just type and have it print with a new printer. You used to be able to do that. You would probably need a dot matrix or letter quality printer to accomplish that.

sekirt


----------



## Bob Cerelli (Nov 3, 2002)

You just run EDIT.

If you have it on a boot disk, you can use it from there. Nice utility that has been around for years as a basic DOS editor. Even uses the old WordPerfect keystrokes for copying, pasting, deleting lines etc.


----------



## bassetman (Jun 7, 2001)

sekirt said:


> When you are at the DOS prompt...where is the text? Is it in a text file?
> If you want to try the EDIT program, type:
> EDIT bassetman.txt and hit Enter.
> 
> ...


Hi When I typed the copy afc.txt I was in the Windows\Options Dir where the file was.

THis really started out as an attempt to list the contents of a Dir output. 

That's all I was hoping for, but it has now kinda of turned into a learning experience! 

I have looked at one of those links, but not DL'ed it or tried it yet.



> You just run EDIT.
> 
> If you have it on a boot disk, you can use it from there. Nice utility that has been around for years as a basic DOS editor. Even uses the old WordPerfect keystrokes for copying, pasting, deleting lines etc.


Thanks


----------



## Cosmic (May 5, 2003)

First you never said what printer you are trying to use??? Or what type of connection it has?

To print in DOS, you need a few basic things. Printer On, connected in the proper way and most software will send a command check to determine the printer is ready. Normally the printer was configured on LPT1. Could use other LPT's but needed either the software program to support it, or you could run an independent utility to switch it before hand. There even were a few serial connected printers around.

There is no driver, each program had to contain the ability to let a user setup the software for their particular printer. It was nothing but a CASE SELECT routine in the program for all the printers supported, could chew up a lot of the program code. Basically was the ESC Codes, things like paper feeding, page formating, fonts, etc, etc, plus anything special which could be program generated. The character set was whatever table had been selected. Usually that was done by hardware via a set of DIP switches in the printer itself.

So one would do what I said before for a simple check in DOS, just do a Print Screen. If that fails to work (Should at least print garbage) then somehow you have a hardware problem and the printer is incapable of receiving any signal.

If you want to do something a little more sophisticated after you know the printer is working, then you must know what that particular printer emulation is in an older printer. Example - I used to have a EPSON Stylus color inkjet ESC/P2. If I wanted to use it in Old DOS (or maybe a DOS prompt window), I would select the LQ-2550 emulation when setting up the DOS software, that will give the correct ESC codes. It should work like an old dot matrix, of course no color, simply because no program of the time, probably supported it. Duh, hadn't been invented yet. 

To set up a DOS program, most programs had a set up utility built-in for printer selection, display color and fonts and whatever other features available. You ran it first before using the software for the first time, selections where saved to disk, the program checked that file, whenever you ran the software. Usually it had a .INI, .SRC, .CRF or whatever type identifier. If the program did not list your printer, you were either screwed or tried to find something close to emulate.

Here are some older word processing programs. I still use PC Write on my old DOS machines.

http://home.pmt.org/~drose/aw-dos-sw-25.html

Here is a download site for PC Write. They even say "*It can be used in a DOS window under Windows 3x, 9x, and higher* ". Duh, I can verify that is true provided you got the printer set up properly.

http://andromeda.rutgers.edu/~ehrlich/465/freeware.html

So the drill to print anything in DOS is first ensure the printer is properly configured hardware wise. If you are trying to use a USB connected printer or something not parallel or at least serial, lots of luck.  The best thing is to simply check the manual of the printer you are trying to use to see if it lists a DOS emulation older printer.

Then do a Screen Print as a quick check the hardware works as configured. If it don't work at that stage, ain't going to work with any software. If it won't Screen Print it ain't connected or configured correctly.

After that you get whatever DOS program desired, run its setup utility (if included), there you would select the older printer emulation in most cases and go on ones merry way.


----------



## bassetman (Jun 7, 2001)

Ok, 

It's an HP 712C printer (not USB) it works fine in Windows.
I tried the Print Screen and the screen flickered bout no printer activity! 

I'll look into the other options a little later! 

Thanks
John


----------



## kiwiguy (Aug 17, 2003)

"Print Screen" does not work like that.

When you do a "Print Screen" it taks a screenshot and saves it on the Clipboard. Then you can Paste it into a document or image program.

There is no suggestion that the 712C actually has any DOS capability when looking on the web, only Windows 3.1, 95 and 98 plus NT are mentioned. Whilst thats not to categorically say it hasn't, usually it would be mentioned I feel.


----------



## bassetman (Jun 7, 2001)

kiwiguy said:


> "Print Screen" does not work like that.
> 
> When you do a "Print Screen" it taks a screenshot and saves it on the Clipboard. Then you can Paste it into a document or image program.
> 
> There is no suggestion that the 712C actually has any DOS capability when looking on the web, only Windows 3.1, 95 and 98 plus NT are mentioned. Whilst thats not to categorically say it hasn't, usually it would be mentioned I feel.


Thanks, I have felt like I am wasting my time!


----------



## Cosmic (May 5, 2003)

Well I went and actually tried it. Bit of a fool's errand. Why do I want to do this anyway? I have two *REAL DOS * working systems and don't need any imitation pretend Windows NOTHING. 

Using XP and a HP DeskJet 870Cxi, Print Screen didn't work. Most of my other methods / Commands that work in REAL DOS didn't work either.

But I got it to finally print in both TREEVIEW running under the DOS Prompt Window and from the command line using PRINT FREE.TXT >PRN where FREE.TXT was the file I wanted to print. DIR > PRN also worked. Yup, printed the text no problem, line feeds and paper feeds where screwed up. Don't know what the old emulation should be, had enough of it.

Old REAL DOS was beautiful, anybody wanting to print in DOS using new equipment and that infernal WINDOWs deserves all the grief Windows can give. A time and a place for all seasons.


----------

