Command Prompt for Windows




Command COLOUR

Function:

Sets foreground and background colours inside a batch file.

Syntax:

COLOUR foreground [background]
foregroundText foreground colour .
backgroundText background colour.

Valid foreground and background colours include :-

  1. System Colours. These colours are predefined and the actual colour displayed depends on which colour is associated to each of the following :-
    FILENAME- file and path names
    NUMBER- numbers
    TEXT- plain text
    HIGHTEXT- highlighted text
    BOLDTEXT- bold text
    ENVNAME- environment variable names
    ENVSTR- environment variable strings
    ERROR- error messages
    LHS- left hand side of equal signs
    HIGHLHS- highlighted left hand side of equal signs
    RHS- right hand side of equal signs
    FILEDATE- file dates
    FILETIME- file times
    FILEATTRIB- file attributes
    FILEDESC- file descriptions
    BACKGRD- background
  2. Fix colours. These colours are fixed. :-
    WHITE
    GREY
    BLACK
    RED
    GREEN
    BLUE
    CYAN
    MAGENTA
    YELLOW

Note:

When the background parameter is not specified the BACKGRD system colour is assumed.

Also see Custom Colours and Colour Schemes and Batch Files.