Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

copy con prn?

456 views
Skip to first unread message

Philip Whittington

unread,
Apr 18, 2000, 3:00:00 AM4/18/00
to
I've been reading my old Dos Manual lately and have come across a use of
COPY which will copy the contents of the screen to the Printer. The manual,
unfortunately doesn't give enough detail on how this works, and doesn't give
any examples. I have to say I'm intriuged about how this will work, after
all of my experimenting has lead to no avail.

Phil Whittington

Rob van der Woude

unread,
Apr 18, 2000, 3:00:00 AM4/18/00
to
Back in the old days (MS-DOS 3.3) Ctrl+P would do the trick. I'm not
sure if this will still work in "modern" DOS.

Good luck,

Rob van der Woude

Reply e-mail address: robw @ xs4all . nl (remove the spaces to e-mail me)
URL: http://www.xs4all.nl/~robw/rob/index.html

Tom Lavedas

unread,
Apr 18, 2000, 3:00:00 AM4/18/00
to
Rob van der Woude wrote:
>
> Back in the old days (MS-DOS 3.3) Ctrl+P would do the trick. I'm not
> sure if this will still work in "modern" DOS.
>
> Good luck,
>
> Rob van der Woude
>
> On Tue, 18 Apr 2000 12:26:31 +0100, Philip Whittington wrote:
>
> >I've been reading my old Dos Manual lately and have come across a use of
> >COPY which will copy the contents of the screen to the Printer. The manual,
> >unfortunately doesn't give enough detail on how this works, and doesn't give
> >any examples. I have to say I'm intriuged about how this will work, after
> >all of my experimenting has lead to no avail.
> >
> >Phil Whittington

Control P works in Win 95, but not Win NT or even 98, but it is not
really a 'print screen', nor does it have anything to do with Copy. It
is more of a 'typewriter' mode (remember those - No? - I'm showing my
age, aren't I).

Further, the question is very confusing to me. I don't know if the
requester wants a print image of the screen (as in the Print Screen key)
or to send the output of a routine to the printer instead of the screen
(i.e. redirection) or to COPY a file to the printer (as in Copy /b
filename.ext prn). I just don't know.

I would need a direct quote from the manual to have an idea to which of
these he is referring.

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/

Philip Whittington

unread,
Apr 18, 2000, 3:00:00 AM4/18/00
to
Cheers for writing to both Tom and Rob, It was really only an idle
wondering. The manual was in fact one of the first I got when I got my PC -
Dos for Dummies (Quick Reference) - I'm almost ashamed to admit that on an
MSDOS newsgroup. The manual talks about copying files to the screen with
stuff like

copy con fastnote.txt

which as far as I can tell does exactly the same as type.

It then talks about typing directly to the computer with

copy con prn

and then pressing Ctrl+Z or F6 when you've finished typing to terminate the
copy command.

I was really wondering what the ramifications are of doing this line in the
middle of a batch file. ie, do the rest of the contents of the Batch file
then get sent to the printer, and if so how do you simulate Ctrl+Z or F6 to
get out of that? Sorry guys, I didn't give you a lot of information to go
on! Don't worry about replying, it's not like a multi million dollar
development programme hangs on it! Cheers for replying though.

Phil

Tom Lavedas <lav...@pressroom.com> wrote in message
news:38FC98F4...@pressroom.com...

Tom Lavedas

unread,
Apr 18, 2000, 3:00:00 AM4/18/00
to
{stuff omitted}

COPY CON fastnote.txt

Permits on the fly creation of a file from the keyboard, without
resorting to an editor program. I still use it (in Win 98SE and NT) on
rare occasion for little test files.

The COPY CON PRN syntax does the same thing, but sends everything typed
at the keyboard to the printer connected to LPT1.

Of course, both of these approaches also display the stuff being typed
on the screen as well. But I wouldn't characterize that as 'sending the
screen to a printer'. A matter of semantics, I guess.

Concerning the inclusion of either of these in a batch file: No, the
rest of the batch file would not somehow become connected to the file
named in the COPY. In fact, the batch procedure would come to a halt
UNTIL the user has pressed a Control-Z and an ENTER (or Control-C) and
there's no way to make the procedure do it instead. Once the Control-Z
and Enter are pressed the procedure would continue merrily on its way
completely oblivious to the whole operation (if you want it to be).

The COPY CON FILENAME.TXT trick is the basis of a method for getting
user input into a running batch procedure, but it is a bit clumsy in
that the user must remember to hit not only Control-Z, but also an
Enter. Plus, reading the information out of the resulting file is not
too easy either. But, it's still advocated from time to time.

Bennett Benson

unread,
Apr 18, 2000, 3:00:00 AM4/18/00
to
Philip,
The console 'con' is used for both input - the keyboard, and for output - the
screen.

When used like the following, it will take keyboard input and copy it to the
file.
copy con fastnote.txt

When used like the following, it will take file input and copy it to the screen.
copy fastnote.txt con


Bennett

>of
>> > >COPY which will copy the contents of the screen to the Printer. The
>manual,
>> > >unfortunately doesn't give enough detail on how this works, and doesn't
>give
>> > >any examples. I have to say I'm intriuged about how this will work,
>after
>> > >all of my experimenting has lead to no avail.
>> > >
>> > >Phil Whittington
>>
>> Control P works in Win 95, but not Win NT or even 98, but it is not
>> really a 'print screen', nor does it have anything to do with Copy. It
>> is more of a 'typewriter' mode (remember those - No? - I'm showing my
>> age, aren't I).
>>
>> Further, the question is very confusing to me. I don't know if the
>> requester wants a print image of the screen (as in the Print Screen key)
>> or to send the output of a routine to the printer instead of the screen
>> (i.e. redirection) or to COPY a file to the printer (as in Copy /b
>> filename.ext prn). I just don't know.
>>
>> I would need a direct quote from the manual to have an idea to which of
>> these he is referring.
>>

KENT LARSSON

unread,
Apr 19, 2000, 3:00:00 AM4/19/00
to
You could also try: (just for laughs)

COPY con nul

or...

COPY nul con

But it does not have ANY use at all, as "nul" is nowhere. But you could
remember it if you need to redirect some input nowhere sometime(if you
want a program to stop showing it´s text).

PROGRAM.EXE >nul

Redirects the program output to nowhere...

Yours sincerly

Kent Larsson, MCP SWEDEN


0 new messages