Tuesday, March 25, 2014

Change the color in the command prompt

  • open  notepad
  • copy and paste the code given below
@ echo off
echo:
echo ……………………………
echo Press 1 for green, 2 for red or 3 for blue, or 4 for exit
echo ……………………………
set /p m=Type 1, 2, or 3, or 4, and press enter:
echo:
if %m%==1 goto 1
if %m%==2 goto 2
if %m%==3 goto 3
if %m%==4 goto 4
:1
color 0a
echo This is the green
goto 4
:2
color 04
echo This is the red
goto 4
:3
color 06
echo This is the blue
goto 4
:4
Pause
goto end
:end
  • save the file by the name yo wish followed by the extension "color.bat"
  • double click,command prompt window will appear type respective number to change the colour

No comments:

Post a Comment

UseFul Links