Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch changing background colour

Tags:

batch-file

It there a way in batch to change the background from black to blue. It must not change the default just for the window that is been run. so if i launch cmd later then it will be the default. If any one can help then thanks.

like image 690
Nato51 Avatar asked Sep 05 '26 23:09

Nato51


2 Answers

color 3f

This changes the current background color.

like image 66
Max Langerak Avatar answered Sep 08 '26 17:09

Max Langerak


I am aware Max has already answered, but thought I would provide more detail.

The command is COLOR, followed by a number and letter combo. Setting, for example, COLOR 0A will make the background color black and the text green. Simply typing COLOR will just set the background to black and the text to white (DEFAULT). Typing COLOR ? will give you the values for colors. I will go ahead and provide them below.

Because of this and I was bored, I made a fun little script that flips through each combo, either by Background or by Text color.

https://github.com/jordanbr20/Batch-CMD-Colors/tree/main

0 = Black       8 = Gray
1 = Blue        9 = Light Blue
2 = Green       A = Light Green
3 = Aqua        B = Light Aqua
4 = Red         C = Light Red
5 = Purple      D = Light Purple
6 = Yellow      E = Light Yellow
7 = White       F = Bright White
like image 38
Jordan Riley Avatar answered Sep 08 '26 18:09

Jordan Riley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!