Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: nyu notesfiles V1.1 4/1/84; site ur-univax.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!rochester!ur-univax!pier From: pier@ur-univax.UUCP Newsgroups: net.micro.pc Subject: Colors in DOS using PROMPT Message-ID: <1200024@ur-univax.UUCP> Date: Fri, 24-May-85 09:26:00 EDT Article-I.D.: ur-univa.1200024 Posted: Fri May 24 09:26:00 1985 Date-Received: Sat, 25-May-85 07:10:38 EDT Organization: University of Rochester: Computing Center Lines: 37 Nf-ID: #N:ur-univax:1200024:000:1687 Nf-From: ur-univax!pier May 24 09:26:00 1985 I was asked to repost an article on how to change the colors in DOS using the DOS PROMPT command. Let me say first that you need the ANSI.SYS device driver installed so that the escape characters sequences can be interpreted. The following is a command I use in a batch file to put the current directory, and the date and time on the top line of the screen, and also set the foregroung and background colors of that line and the rest of the screen. This batch file has 4 parameters: the foreground color of the top line the background color of the top line the foreground color of the rest of the screen the background color of the rest of the screen PROMPT $E[s ! save current cursor position $E[0;0H ! go to home position $E[3%1m$E[4%2m ! set foreground (%1) and background (%2) ! colors of top line Directory: $P $D $T ! print directory, date and time $E[K ! erase rest of line $E[3%3m$E[4%4m ! foreground (%3) and background (%4) ! colors of rest of screen $E[K$E[u ! erase rest of line with new bacground ! color and restore cursor position $N$G ! print the usual DOS prompt (drive and >) This command is commented here. To use it, remove the comments and put everything on one single line, as the argument of the DOS PROMPT command ends at the end of the line. Hope this helps. Pierre Darmon University of Rochester