Computing.Net > Forums > Disk Operating System > Color Dos Command Batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Color Dos Command Batch file

Reply to Message Icon

Name: freaku
Date: August 26, 2002 at 17:36:29 Pacific
Comment:

I haven use Dos Command for a very long time & now forget whats are the command for background and text color.
I have load device=c:\windows\command\ansi.sys in CONFIG.SYS
But how do I make colors using batch file.

Any Ideas Guys



Sponsored Link
Ads by Google

Response Number 1
Name: freaku
Date: August 26, 2002 at 18:30:16 Pacific
Reply:

Thanks anyway I've figure it out


0

Response Number 2
Name: sameer
Date: August 27, 2002 at 10:10:05 Pacific
Reply:

hi
i have lot of problem with batch.bat file as i am new to it so pls give the solution for " how to color my dos batch file
reply soon
sameer


0

Response Number 3
Name: SourceWarrior
Date: August 31, 2002 at 15:43:26 Pacific
Reply:

Hi out there: use my code (copy it into a .bat-file)

@echo off

if "%1"=="/?" goto USAGE
if "%1"=="black" set Textf=30
if "%1"=="red" set Textf=31
if "%1"=="green" set Textf=32
if "%1"=="yellow" set Textf=33
if "%1"=="blue" set Textf=34
if "%1"=="lred" set Textf=35
if "%1"=="lblue" set Textf=36
if "%1"=="white" set Textf=37

if "%2"=="black" set Hintf=40
if "%2"=="red" set Hintf=41
if "%2"=="green" set Hintf=42
if "%2"=="yellow" set Hintf=43
if "%2"=="blue" set Hintf=44
if "%2"=="lred" set Hintf=45
if "%2"=="lblue" set Hintf=46
if "%2"=="white" set Hintf=47

prompt $e[%Textf%;%Hintf%m$p$g
cls
goto end

:USAGE
echo.
echo Žndert die Farben von MS-DOS
echo.
echo syntax: COLOUR [Colour1] [Colour2]
echo.
echo Colour1: Farbe fr die Textausgabe
echo Colour2: Farbe fr den Hintergrund
echo.
echo M”gliche Farben fr Colour1, Colour2:
echo.
echo black, red, green, yellow, blue,
echo lblue, lred, white
echo.

:end


0

Response Number 4
Name: Sonny
Date: September 2, 2002 at 17:11:03 Pacific
Reply:

@PROMPT $E[31;44m [DRS-ME] $P$G

This in autoexec will give a blue background with red lettering and will display your current dir with DRS-ME as a prompt
The numbers 31 & 44 control the colors
valide numbers are 30 thru 35 and 40 thru 45


0

Response Number 5
Name: Sonny
Date: September 2, 2002 at 17:12:32 Pacific
Reply:

Oops forgot to mention you do have to have ansi loaded via the config


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Color Dos Command Batch file

DOS Batch File Help www.computing.net/answers/dos/dos-batch-file-help/15090.html

Color for batch files www.computing.net/answers/dos/color-for-batch-files/3489.html

DOS find batch file www.computing.net/answers/dos/dos-find-batch-file/9384.html