Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!uwvax!oddjob!mimsy!cvl!umd5!umbc3!stevenj From: stevenj@umbc3.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: DOS command in batch file does not work when "echo off" Message-ID: <304@umbc3.UMD.EDU> Date: Fri, 13-Mar-87 22:14:19 EST Article-I.D.: umbc3.304 Posted: Fri Mar 13 22:14:19 1987 Date-Received: Sat, 14-Mar-87 15:19:42 EST References: <5792@mimsy.UUCP> Reply-To: stevenj@umbc3 (Steven Vore (PC)) Organization: University of Maryland, Baltimore County Lines: 35 In article <5792@mimsy.UUCP> deba@mimsy.UUCP (Deba Patnaik) writes: >PROMPT command does not work when "ECHO OFF'" but works when >"ECHO ON". These are the lines in the batch file. > >ECHO OFF >IF %1 == RED PROMPT $e[41m >IF %1 == GREEN PROMPT $e[42m > >If you have a CGA card try it with echo on and off. If you know >the reason why it does not work please let me know. Hope it is >not a bug in 3.1 DOS. No, not a bug in DOS at all. The above commands will utilize ANSI.SYS to change screen colors. ANSI.SYS, being a video driver (correct term?) can only get it's commands from things being displayed to the screen, in your case, an , a right bracket, etc. (DOS translates the $e to an character). When you turn ECHO OFF, the command is not displayed to the screen, hence ANSI.SYS never sees it, causing the seeming bug. a workaround: put the commands in a file and then TYPE the file. by commands, I mean an , right bracket etc. (you'll have to find a text editor that'll let you put the character in the file - SideKick will for example, I think it's ^P then , but check the manual to be sure). If you do it right, you'll never see anything but the screen color change. your .BAT file would then look like.. if %1 == RED type REDFILE if %1 == GREEN type GREENFILE ... hope this helps. Steven J Vore stevenj@umbc3.umd.edu ------------------------------------------------------------------------