Xref: utzoo comp.sys.ibm.pc:29855 comp.binaries.ibm.pc.d:3352 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!ncrlnk!ncr-sd!rb-dc1!shapiro From: shapiro@rb-dc1.UUCP (Mike Shapiro) Newsgroups: comp.sys.ibm.pc,comp.binaries.ibm.pc.d Subject: Re: How to hide 'echo off' in batch files? Message-ID: <553@rb-dc1.UUCP> Date: 7 Jun 89 15:18:04 GMT References: <9139@boulder.Colorado.EDU> Reply-To: shapiro@rb-dc1.SanDiego.gould.UUCP (Mike Shapiro) Organization: Gould CSD, San Diego Lines: 61 In article <9139@boulder.Colorado.EDU> haverlan@tramp.Colorado.EDU (HAVERLAND MARC BRADLEY) writes: > >I put the command 'echo off' at the top of most of my batch files to >hide the following commands. However, 'echo off' is still displayed. > >Does anyone know how to turn off echoing in a batch file without >showing the 'echo off?' > For DOS 3.3 and above, just put a "@" before the echo off on the first line. For earlier DOS, here is the technique I learned several years ago to patch the COMMAND.COM file on any version of MS-DOS or PC-DOS to make the initial echo status for BAT files OFF. It is reproduced from memory and some quick experiments, so no guarantees, of course. 1. Make a copy of COMMAND.COM and work on it. >COPY COMMAND.COM COMX.COM 2. Run DEBUG and enter the commands shown. (Do not enter the commentary) >DEBUG COMX.COM -s 0,5fff 24 01 Find the byte sequence 24 01. xxxx:1B2B DEBUG replies with addresses it finds bytes. -u1b18 Disassemble starting with previous instruction: xxxx:1B28 A0FC0A MOV AL,[0AFC] xxxx:1B2B 2401 AND AL,01 ... -e1B2C 00 Patch the 01 byte to 00 -s 0,5fff fc 0a 03 Find the address in the above disassembled instruction followed by the byte 03 xxxx:115C -u115a To check, disassemble the instruction: xxxx:115A C606FC0A03 MOV BYTE PTR [0AFC],03 ... -e115e 02 Patch the 03 byte to 02 -w Write the modified file -q Quit (The above addresses are from PC-DOS 3.21. The "xxxx:" depends on your memory use at the time you run DEBUG.) 3. Do a binary comparison of the COMX.COM and original COMMAND.COM files. Only the two bytes should have changed, 03 to 02 and 01 to 00. To test it, on a floppy formatted with the /S option, replace COMMAND.COM with the COMX.COM, renaming it COMMAND.COM. Then reboot with the floppy. If all works well, rename COMMAND.COM to some other name such as COMMAND.COX and COMX.COM to COMMAND.COM in your normal boot directory (As I recall, the first patch indicates an "echo off" status during execution of a BAT file statement. The second patch selects "echo off" as the initial status for an AUTOEXEC.BAT file. It's been several years since I've done this, so I may be slightly wrong on the reasons.) Best of luck. -- Michael Shapiro, Encore Computer Corporation (formerly Gould/GSD) 15378 Avenue of Science, San Diego, CA 92128 (619)485-0910 UUCP: shapiro@rb-dc1 (This location will close, starting July 10. I will be moving on.)