How to change text color of cmd with windows batch script every 1 second
The color command has to do with changing color of windows command promt background/text
color 0A – where 0 is the background color and A is the text color
I want to change these color of text every 1 second in windows batch script using an array with 1,2,3,4,5,6,7,8,9,A,B,C,D,E,F witch are the color codes.
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
the command should be go every second like this
color 01
color 02
color 03
....
color 0E
color 0F
and for these i found some little script but im not sure how to make it work to change the color for every 1 second!
for /L %%i in (1,1,%n%) do echo !array[%%i]!
or this
@echo off CLS
for /l %%a in (15,-1,1) do (
color 0A
cls
)
pause
or this
SET COUNTDOWN=15
:COUNTDOWNLOOP
IF %COUNTDOWN%==0 GOTO END
color 0A && %R1%
CLS
SET /A COUNTDOWN -=1
GOTO COUNTDOWNLOOP
:END
How to get even more color schemes for command prompt
Although the Color Tool includes a few color schemes, it’s possible to use many other colors using .itermcolors scheme files, which you can find on the internet.
The one that Microsoft recommends is the iTerm2 Color Schemes, which is an open project found in GitHub that offers more than 150 color schemes that you can use with Command Prompt.
If you want to use these schemes, do the following.
- Download iTerm2-Color-Schemes from GitHub (click the green Clone or download button and select Desktop ZIP).
- Unzip the content of the iTerm2-Color-Schemes.zip compressed file. (If you need help, use this guide to extract all the files from a zip file.)
- Open the schemes folder inside the iTerm2-Color-Schemes uncompressed folder.
- Select everything inside schemes folder (Ctrl A) and copy the content (Ctrl C).
- Open the schemes folder inside the colortool folder and paste the files (Ctrl V).
After completing the steps, use the steps to use Color Tool to apply a new color scheme, including Batman, Darkside, Atom, C64, FirefoxDev, and many others.
Which color scheme did you choose for your installation? Tell us in the comments.
More windows 10 resources
For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:
Параметры
В следующей таблице перечислены допустимые шестнадцатеричные числа, которые можно задать в качестве значений параметров т и ф.
Примеры использования
Чтобы изменить цвет текста на красный, а цвет фона на белый в окне командной строки, введите следующую команду:
color FC
Синтаксис
color> [тф]
Где т – цвет текстаф – цвет фона
Различные цвета текста для ввода и вывода в cmd.exe
Установка цветов по умолчанию для текста и фона в текстовых окнах.
COLOR [цвета]
цвета Атрибуты цветов для текстовых окон
Атрибуты цветов задаются в виде ДВУХ шестнадцатеричных цифр — первая
задает цвет фона, а вторая определяет цвет текста. Каждая цифра может
иметь следующие значения:
0 = Черный 8 = Серый
1 = Синий 9 = Светло-синий
2 = Зеленый A = Светло-зеленый
3 = Голубой B = Светло-голубой
4 = Красный C = Светло-красный
5 = Лиловый D = Светло-лиловый
6 = Желтый E = Светло-желтый
7 = Белый F = Ярко-белый
Если аргумент не указан, команда восстанавливает исходный выбор
цветов, каким он был на момент запуска CMD.EXE. Это значение
извлекается из текущего текстового окна, из значения ключа /T или из
значения параметра реестра DefaultColor.
Это из справки к команде color
.
например, дайт “хацкерский” терминал – кислотно-зеленые буквы на черном фоне.