[comp.sys.ibm.pc] BAT files and ECHO OFF

bl@infovax.UUCP (Bj|rn Larsson) (04/30/89)

Dear everybody, long ago there circulated a number of binary patches
to COMMAND.COM (for DOS 2.x and 3.1) that set ECHO to default to OFF
when a .BAT file was executed. I like not to see the first statement
'ECHO OFF' echoed when a batch is run, so does anybody have this in-
formation for DOS 3.3 COMMAND.COM. (I guess I could browse around a
little in the executeable with some debugger, assuming that only the
location of the code has changed, not the code itself {at least not
drastically}. Still, if anybody already knows...)

You can mail me as bl@infovox.SE (or maybe others also want this, so
it's worth posting a reply.)

Thanks to you all (if you reply ;-),			-- Bjorn

 ====================== InfoVox = Speech Technology =======================
 Bjorn Larsson, INFOVOX AB          ::         bl@infovox.SE
 Box 2503                           ::
 S-171 02 Solna, Sweden             ::         Phone (+46) 8 735 80 90



-- 
 ====================== InfoVox = Speech Technology =======================
 Bjorn Larsson, INFOVOX AB          ::      ...seismo!mcvax!enea!infovax!bl
 Box 2503                           ::         bl@infovax.se.UUCP
 S-171 02 Solna, Sweden             ::         Phone (+46) 8 735 80 90

rwberry@hubcap.clemson.edu (Robert W Berry) (05/01/89)

From article <161@infovax.UUCP>, by bl@infovax.UUCP (Bj|rn Larsson):
> 
     [stuff about needing DOS 3.3 patch to set echo default to off]
> 

     One the nice features of PC-DOS 3.3 (I'm not sure about MS-DOS 3.3
though) is that Microsoft finally caught this pain in the ***.  They
implemented a new form of the echo command (@echo) that prevents it from
being displayed.

     Try "@echo off" as the first line of your batch file.

>  ====================== InfoVox = Speech Technology =======================
>  Bjorn Larsson, INFOVOX AB          ::         bl@infovox.SE
>  Box 2503                           ::
>  S-171 02 Solna, Sweden             ::         Phone (+46) 8 735 80 90

     Hope this helps,
     Bob
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-=- Bob Berry -=- PC-Guru's Inc.         ! rwberry@hubcap.clemson.edu   -=-
-=- We are the science of modern motion. ! 803-654-7623 || 803-656-2635 -=-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

emmonsl@csusac.uucp (L. Scott Emmons) (05/01/89)

In article <161@infovax.UUCP>, bl@infovax.UUCP (Bj|rn Larsson) writes:
> 
> [...] there circulated a number of binary patches
> to COMMAND.COM (for DOS 2.x and 3.1) that set ECHO to default to OFF
> when a .BAT file was executed.

  [pruned]

> [...] so does anybody have this in
> formation for DOS 3.3 COMMAND.COM.

I also am interested in these patches...for MSDOS 3.2.  Perhaps someone can
post them to the pc binaries newsgroup?

			lse
			"No sig's enough sig for me"

jeffery@jsheese.FIDONET.ORG (Jeff Sheese) (05/02/89)

In an article of <30 Apr 89 15:07:44 GMT>, bl@infovax.UUCP (Bj|rn Larsson) writes:

 >Dear everybody, long ago there circulated a number of binary patches
 >to COMMAND.COM (for DOS 2.x and 3.1) that set ECHO to default to OFF
 >when a .BAT file was executed. I like not to see the first statement
 >'ECHO OFF' echoed when a batch is run, so does anybody have this in-
 >formation for DOS 3.3 COMMAND.COM.

All PCDOS 3.3 batch file commands preceded with '@' will not be echoed to the 
screen.  Therefore if you have the command '@Echo OFF' in the first line
of the batch file, ECHO will be switched off and the command will not
be echoed to the screen.
--  
Jeff Sheese - via FidoNet node 1:109/116
UUCP: ...!netsys!jsheese!jeffery
(Send all replies to netsys!jsheese!jeffery)
(Send all flames to null@netsys!jsheese!jeffery)

malloy@nprdc.arpa (Sean Malloy) (05/02/89)

In article <5350@hubcap.clemson.edu> rwberry@hubcap.clemson.edu (Robert W Berry) writes:
>From article <161@infovax.UUCP>, by bl@infovax.UUCP (Bj|rn Larsson):

>     [stuff about needing DOS 3.3 patch to set echo default to off]

>     One the nice features of PC-DOS 3.3 (I'm not sure about MS-DOS 3.3
>though) is that Microsoft finally caught this pain in the ***.  They
>implemented a new form of the echo command (@echo) that prevents it from
>being displayed.

>     Try "@echo off" as the first line of your batch file.

It's more general than that; in DOS 3.3, using an '@' as the first
character of a batch file command prevents the command from being
echoed regardless of the command -- "@SET 87=Y", for example, simply
doesn't echo. And you reduce the number of commands in your batch file
through not having all the echo on/off commands.


 Sean Malloy					| "The proton absorbs a photon
 Navy Personnel Research & Development Center	| and emits two morons, a
 San Diego, CA 92152-6800			| lepton, a boson, and a
 malloy@nprdc.navy.mil				| boson's mate. Why did I ever
						| take high-energy physics?"

dalm@warwick.UUCP (D A L Michael) (05/02/89)

In article <161@infovax.UUCP> bl@infovax.UUCP (Bj|rn Larsson) writes:
>
>Dear everybody, long ago there circulated a number of binary patches
>to COMMAND.COM (for DOS 2.x and 3.1) that set ECHO to default to OFF
>when a .BAT file was executed. I like not to see the first statement
>'ECHO OFF' echoed when a batch is run, so does anybody have this in-
>formation for DOS 3.3 COMMAND.COM. (I guess I could browse around a
>little in the executeable with some debugger, assuming that only the
>location of the code has changed, not the code itself {at least not
>drastically}. Still, if anybody already knows...)

Well, this is a case of READ THE MANUAL!

In DOS 3.3 there is a facility for batch files to NOT echo a command to
screen. It is by starting the line with an @ sign. So if you start your
autoexec.bat file and any other .bat files you have with:

@echo off
...rest of stuff

Then you will never see the ECHO OFF appear on the screen.
--------------------------[ dalm@uk.ac.warwick ]-----------------------------
ARPA:	dalm%warwick.uucp%emerald.warwick.ac.uk@ucl-cs.arpa
UUCP:   ... seismo!mcvax!ukc!warwick!daisy!emerald!dalm
JANET:  dalm%warwick.uucp@uk.ac.warwick.emerald       PHONE: (+44) 203 692320
TELEX:  837831 EMCO G, 837831 VIA OR G                  FAX: (+44) 865 726753
----------------------------[ David Michael ]--------------------------------

msschaa@cs.vu.nl (Schaap MS) (05/02/89)

In article <161@infovax.UUCP> bl@infovax.UUCP (Bj|rn Larsson) writes:
>
>Dear everybody, long ago there circulated a number of binary patches
>to COMMAND.COM (for DOS 2.x and 3.1) that set ECHO to default to OFF
>when a .BAT file was executed. I like not to see the first statement
>'ECHO OFF' echoed when a batch is run, so does anybody have this in-
>formation for DOS 3.3 COMMAND.COM. (I guess I could browse around a



   In DOS 3.30 (maybe others) you can use



       _
      / \
      |a/ echo off
      \

       ^
       |
   (not this one, but the real one)

as the first line. It won't be displayed.

leif@ambush.dk (Leif Andrew Rump) (05/03/89)

In article <1802@ubu.warwick.UUCP>, dalm@warwick.UUCP (D A L Michael) writes:
> In article <161@infovax.UUCP> bl@infovax.UUCP (Bj|rn Larsson) writes:
> >Dear everybody, long ago there circulated a number of binary patches
> >to COMMAND.COM (for DOS 2.x and 3.1) that set ECHO to default to OFF
> >when a .BAT file was executed. I like not to see the first statement
> >'ECHO OFF' echoed when a batch is run, so does anybody have this in-
> >formation for DOS 3.3 COMMAND.COM. (I guess I could browse around a
> Well, this is a case of READ THE MANUAL!
> 
> @echo off
> ...rest of stuff
> 
> Then you will never see the ECHO OFF appear on the screen.

Well that depends if you are using DOS 3.3 from third party (like
Olivetti), MicroSoft OR IBM! Some of them recognize the @ others don't!
Long live the free will (and stupidity) from computer industry!

  Leif Andrew Rump, AmbraSoft A/S, Roejelskaer 15, DK-2840 Holte, Denmark
 UUCP: leif@ambra.dk, phone: +45 42424 111, touch phone: +45 42422 817+313

   > > > Why are tall Irish girls with red hair so wonderful ? ? ? < < <

freiss@nixpbe.uucp (05/04/89)

bl@infovax.UUCP writes:

>Dear everybody, long ago there circulated a number of binary patches
>to COMMAND.COM (for DOS 2.x and 3.1) that set ECHO to default to OFF
>when a .BAT file was executed. I like not to see the first statement
>'ECHO OFF' echoed when a batch is run, so does anybody have this in-
>formation for DOS 3.3 COMMAND.COM. (I guess I could browse around a

I don't know if there is a binary patch out there in netland, but
the famous 'ECHO OFF' problem can be solved using an undocumented
feature of DOS 3.3: Lines beginning with the '@' (at) character
are never echoed. Replacing 'ECHO OFF' with '@ECHO OFF' will spare
your sore eyes the ungainly sight :-) of an echoed 'ECHO'.

- Martin

--
 Martin Freiss        UUCP:   USA: ..!uunet!philabs!linus!nixbur!freiss.pad
 Nixdorf Computer AG         !USA: ..!mcvax!unido!nixpbe!freiss.pad
 Dept. DS2            NERV:  freiss.pad
 Pontanusstr. 55
 D-4792 Paderborn

ray@philmtl.philips.ca (Raymond Dunn) (05/06/89)

In article <971@ambush.dk> leif@ambush.dk (Leif Andrew Rump) writes:
 > [advice to use @ to inhibit echo ]
 > Well that depends if you are using DOS 3.3 from third party (like
 > Olivetti), MicroSoft OR IBM! Some of them recognize the @ others don't!
 > Long live the free will (and stupidity) from computer industry!

Only if the third party is pretending that a release is 3.3 when it is not!

Other than IBM, third party suppliers do not have the capability of modifying
the behaviour of DOS at this level.

Would anyone care to identify the supplier whose DOS 3.3 does not have this
feature?

-- 
Ray Dunn.                    | UUCP: ..!uunet!philmtl!ray
Philips Electronics Ltd.     | TEL : (514) 744-8200  Ext: 2347
600 Dr Frederik Philips Blvd | FAX : (514) 744-6455
St Laurent. Quebec.  H4M 2S9 | TLX : 05-824090

allbery@ncoast.ORG (Brandon S. Allbery) (05/08/89)

As quoted from <1802@ubu.warwick.UUCP> by dalm@warwick.UUCP (D A L Michael):
+---------------
| In article <161@infovax.UUCP> bl@infovax.UUCP (Bj|rn Larsson) writes:
| >when a .BAT file was executed. I like not to see the first statement
| >'ECHO OFF' echoed when a batch is run, so does anybody have this in-
| >formation for DOS 3.3 COMMAND.COM. (I guess I could browse around a
| 
| Well, this is a case of READ THE MANUAL!
+---------------

There IS a valid reason to want to patch the 3.3 executable.  It's called
COMPATIBILITY.  What if I want to run the same .BAT file on my Toshiba T1000?
(DOS 2.11 in ROM.  Run the BAT file and watch it b*tch about the blasted @.)

Kindly THINK before flaming.  (G*d forbid that *anyone* should do so!)

++Brandon
-- 
Brandon S. Allbery, moderator of comp.sources.misc	     allbery@ncoast.org
uunet!hal.cwru.edu!ncoast!allbery		    ncoast!allbery@hal.cwru.edu
      Send comp.sources.misc submissions to comp-sources-misc@<backbone>
NCoast Public Access UN*X - (216) 781-6201, 300/1200/2400 baud, login: makeuser

msschaa@cs.vu.nl (Schaap MS) (05/08/89)

In article <24000003@nixpbe> freiss@nixpbe.uucp writes:
>
>
>I don't know if there is a binary patch out there in netland, but
>the famous 'ECHO OFF' problem can be solved using an undocumented
>feature of DOS 3.3: Lines beginning with the '@' (at) character
>are never echoed. Replacing 'ECHO OFF' with '@ECHO OFF' will spare
>your sore eyes the ungainly sight :-) of an echoed 'ECHO'.
>
This is NOT an undocumented feature.

It is described in the IBM Dos 3.30 Reference Manual.

) Seaman) (05/12/89)

allbery@ncoast.ORG (Brandon S. Allbery) writes:

[ Discussion (and flames) regarding patches to DOS3.3 for echo off... ]

-> There IS a valid reason to want to patch the 3.3 executable.  It's called
-> COMPATIBILITY.  What if I want to run the same .BAT file on my Toshiba T1000?
-> (DOS 2.11 in ROM.  Run the BAT file and watch it b*tch about the blasted @.)
-> 
-> ++Brandon
-> -- 
-> Brandon S. Allbery, moderator of comp.sources.misc	     allbery@ncoast.org
-> uunet!hal.cwru.edu!ncoast!allbery		    ncoast!allbery@hal.cwru.edu

If compatibility is what you are after, then a patch is definitely not
the answer.  What about the millions of users of DOS (ANY version) who
do NOT have a patched command.com?  Since batch files intended for a
patched version may not have an 'echo off' at the beginning, these users
might have to watch the whole bloody batch file print on screen as it
executes.

If someone wants to patch their command.com, and someone else has the
procedure, then go for it.  But make sure that, if compatibility is an
issue, that any batch files created reach the lowest common denominator.

As for my personal batch files, they all begin with '@echo off'.

-- 
Chris (Insert phrase here) Seaman |   o\  /o                See
crs@cpsc6a.att.com <or>           |     ||     "Attack of the Killer Smiley"!
..!att!cpsc6a!crs                 |  \vvvvvv/           Coming Soon
                                  |   \____/      to a newsgroup near you!

stephen@ziebmef.uucp (Stephen M. Dunn) (05/12/89)

   Not outputting ECHO OFF messages is a piece of cake in DOS 3.3, as
the clowns at Microsoft finally got around to eliminating the pain-in-the-
ass requirement that your ECHO OFF would always get printed.  In 3.3, you
put @ECHO OFF instead of ECHO OFF and it won't print it.  No patches needed
to COMMAND.COM or anything!  It's too bad Microsoft didn't improve their
batch files until 3.3 with @ECHO OFF and the CALL command ... you would
think that somebody within Microsoft would have suggested such features
when DOS was still young.  Or maybe that means that they don't use their
own O/S and are unaware of its oversights :-)
-- 
-------------------------------------------------------------------------------
! Stephen M. Dunn              stephen@ziebmef.UUCP ! DISCLAIMER:  Who'd ever !
! Take off to the Great White North eh, ya hosehead ! claim such dumb ideas?  !
-------------------------------------------------------------------------------