[comp.sys.ibm.pc] Echo Off! Dammit!

amlovell@phoenix.Princeton.EDU (Anthony M Lovell) (03/21/88)

A wise man once asked:
>>  Is there any way to create batch files that don't echo 
>>  their contents to the screen?  If I precede the other 
>>  commands in the .BAT file with 'ECHO OFF' then the @#&%*!
>>  'ECHO OFF' gets echoed!   

>C:> x.bat > nul
> Cliff Joslyn, Professional Cybernetician 

BZZT!  You can't do this.  Output of a batch file cannot be redirected
wholesale.  To pursue this further, echo off >nul as the first line of
the batch file also will not work.  DOS really wanted to screw you over
on this little flaw, and I think they succeeded.

-- 
amlovell@phoenix.princeton.edu     ...since 1963.

disclaimer:
These are MY opinions.  You only WISH they were yours.

murillo@sigi.Colorado.EDU (Rodrigo Murillo) (03/21/88)

In article <2110@phoenix.Princeton.EDU> amlovell@phoenix.Princeton.EDU (Anthony M Lovell) writes:
>[examples of how impossible it is to avoid the ECHO OFF message from
> a batch file...]
>wholesale.  To pursue this further, echo off >nul as the first line of
>the batch file also will not work.  DOS really wanted to screw you over
>on this little flaw, and I think they succeeded.
 
I saw a patch posted a long time ago in PC Magazine that would patch
command.com so that the default was ECHO OFF.  Does anybody out there have that
patch,  or maybe someone would like to figure it out.  I used it on a system
once it it was great not to have to write batch files that always started
with 'ECHO OFF;CLS'.
-- 
_______________________________________________________________________________
 Rodrigo Murillo, University of Colorado - Boulder  (303) 761-0410 
 murillo@boulder.colorado.edu | ..{hao|nbires}!boulder!murillo
 ( Machines have less problems.  I'd like to be a machine. -- Andy Worhol )

bloom@inmet.UUCP (03/22/88)

	With DOS 3.3 (don't know about earlier), lines in a batch file
that begin with the character '@' are not echoed.

	Therefore, if the first line is '@ECHO OFF', no lines are echoed
to the console.


Ray Bloom
Internet:	bloom@inmet.inmet.com
UUCP:		{ima,ihnp4,esquire,harpo,mirror,bellcore,...}!inmet!bloom

toddg@hpldoma.HP.COM (Todd Goin) (03/22/88)

/ hpldoma:comp.sys.ibm.pc / amlovell@phoenix.Princeton.EDU (Anthony M Lovell) /  9:56 am  Mar 20, 1988 /
A wise man once asked:
>>  Is there any way to create batch files that don't echo 
>>  their contents to the screen?  If I precede the other 
>>  commands in the .BAT file with 'ECHO OFF' then the @#&%*!
>>  'ECHO OFF' gets echoed!   

My Answer (UGLY AS IT IS!) ?

	echo off
	cls
	<rest of bat file>

I am not happy, but the clearscreen happens fast enough that I almost
don't even notice the "ECHO OFF" sent to the display.  Now, what about
that data that I don't want to blow away...

Todd Goin
HP Electronic Design Division

Usual stuff about:  These are my own opinions...

awylie@pyr1.cs.ucl.ac.uk (03/24/88)

But who the hell cares if ECHO OFF gets echoed ??????
This is just another stupid mountain-out-of-molehill posting so
typical of this newsgroup.

------------------------------------------------------------
Andrew Wylie, University of London Computer Centre,
20 Guilford Street, London WC1N 1DZ, England.

JANET:      andrew@uk.ac.ulcc.ncdlab          "I can't complain,
UUCP:       ..!mcvax!ukc!cs.ucl.ac.uk!awylie   but sometimes I still do."
ARPA:       awylie@cs.ucl.ac.uk
BITNET:     andrew%uk.ac.ulcc.ncdlab@ac.uk

If replying via satnet please give a UUCP path from mcvax to
your site.

simrin@mis.ucsf.edu (Steve Simrin) (03/25/88)

In article <149000020@inmet> bloom@inmet.UUCP writes:
>
>	With DOS 3.3 (don't know about earlier), lines in a batch file
>that begin with the character '@' are not echoed.
>
>	Therefore, if the first line is '@ECHO OFF', no lines are echoed
>to the console.

The following also works (sort of):

		echo off
		echo ^[[s^[[1A^[K^[[u

where "^[" is an escape character. This "trick" works in DOS 2.0 + and
requires ansi.sys.

t-gregr@microsoft.UUCP (Greg Reddick) (03/25/88)

For those of you who are trying to turn off the echo, the
proper way is to buy a copy of MS-DOS 3.3, then include the 
line:

@echo off

at the beginning of the batch file.

The '@' symbol says not to echo the line in MS-DOS 3.3.

...no fancy signature yet!

eh6c@clutx.clarkson.edu (Tom Buskey) (03/26/88)

Echo can be turned off in an autoexec file by the following:
ECHO OFF > NUL

halvers@iraq.steinmetz (peter c halverson) (03/27/88)

In article <39500009@pyr1.cs.ucl.ac.uk> awylie@pyr1.cs.ucl.ac.uk writes:
>
>But who the hell cares if ECHO OFF gets echoed ??????

Those of us who are trying to encapsulate and hide the particularly ugly
details of MS-DOS from naive users who think that "C>" is arcane enough,
without seeing the kludge/magic of "batch" (hmmph) files.  Those of us who
care about a reasonably clean user interface, i.e. one without extraneous
crap [no comments about the oxymoronicism of "MS-DOS" and "clean user
interface"].  Those of us who are driven bonkers by the continued presence
of an onerous "feature" that should never have survived beta test, much
less lived past version 1.1.

>This is just another stupid mountain-out-of-molehill posting so
>typical of this newsgroup.

Unfortunately, this is one of those questions that continually pops up, in
various guises, on just about every newsgroup.  It'd be nice if everybody
would recognize these for what they are, wait for one person to gently post
a short answer, and move on, but that isn't going to happen.  Getting your
dander up won't do much -- I've seen very few meta-flames that did much
more than compensate for the flamer's bad day at work (and I guess this
could be considered a (hopefully mild) meta-meta-flame :-)

>Andrew Wylie, University of London Computer Centre,



~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Pete Halverson                       ARPA: halverson@ge-crd.ARPA
GE Corporate R&D Center	             UUCP: uunet!steinmetz!iraq!halvers
Schenectady, NY				   halvers@iraq.steinmetz.UUCP

nather@ut-sally.UUCP (Ed Nather) (03/28/88)

In article <39500009@pyr1.cs.ucl.ac.uk>, awylie@pyr1.cs.ucl.ac.uk writes:
> 
> But who the hell cares if ECHO OFF gets echoed ??????

I do.

I've put together a Unix-like system for MS-DOS that makes use of batch
files as command names, and a lot of people use it.  I want all the commands
to look the same to the user, whether they are realized in asm code, in C,
or as batch files.  Ohterwise novice users get confused.

> This is just another stupid mountain-out-of-molehill posting so
> typical of this newsgroup.
> 

I don't agree, but I think your posting meets the criterion of uselessness.
And transatlantic, too!

-- 
Ed Nather
Astronomy Dept, U of Texas @ Austin
{allegra,ihnp4}!{noao,ut-sally}!utastro!nather
nather@astro.AS.UTEXAS.EDU