Adding a "color config" to batch scripts.
(i made this tut, cuz i was bord) but its still a useful sript
say you wana change the color of a Batch file, with out edditing the file.
All you need to do is to add a few extra commands, or scripts, to the
batch file, once you do so, you well no longer need to keep modifing the
file.
the three things you need are three batch files
1, normal batchfile "the one you want to change"
2. color menu
3, color save
a normal batch file with color text would have just the plane "color" command.
--example
as you can see i put "color a" since i wanted green text, now ima show you
how to change the color code with a save file.
--example
as you can see, we replaced the normal "color" command with a "%color%" and have also
added the "call" command. What i did was, i made a nother cmd fiile that has a nother color
command in it
--example
all it has is a "color" code, you see, when we "call" the color file, it well read that it has
"color 1" in it, because of this, it well replace "%color%" with color 1, now to get this
"color 1" or any color realy, in the color save, we need to make a color menu
--example
now, as you can see, we have three colors in the menu, we have "blue, green, and white"
also, as you can see, once we press 1, 2, or 3, it puts or "echos" the color code in to the "ColorSave"
file, then when are batch file douse the "call" command for the color save, it reads the color code
and changes the color of the batch file
now by adding those two lines of code in are main file, we can change the color of it by just oping up the
menu, and it well auto save the color, so next time you open it, it well be the color. (or any color that you set)
(i made this tut, cuz i was bord) but its still a useful sript
say you wana change the color of a Batch file, with out edditing the file.
All you need to do is to add a few extra commands, or scripts, to the
batch file, once you do so, you well no longer need to keep modifing the
file.
the three things you need are three batch files
1, normal batchfile "the one you want to change"
2. color menu
3, color save
a normal batch file with color text would have just the plane "color" command.
--example
- Code:
@echo off
color a
echo Text Here
pause
as you can see i put "color a" since i wanted green text, now ima show you
how to change the color code with a save file.
--example
- Code:
@echo off
call "C:\ColorSave.cmd"
%color%
cls
echo Text Here
pause
as you can see, we replaced the normal "color" command with a "%color%" and have also
added the "call" command. What i did was, i made a nother cmd fiile that has a nother color
command in it
--example
- Code:
color 1
all it has is a "color" code, you see, when we "call" the color file, it well read that it has
"color 1" in it, because of this, it well replace "%color%" with color 1, now to get this
"color 1" or any color realy, in the color save, we need to make a color menu
--example
- Code:
@echo off
:home
echo 1 = blue
echo 2 = green
echo 3 = white
set /p Option=
if %Option% == 1 echo color 1 > C:\ColorSave.cmd
if %Option% == 2 echo color a > C:\ColorSave.cmd
if %Option% == 3 echo color 7 > C:\ColorSave.cmd
goto home
now, as you can see, we have three colors in the menu, we have "blue, green, and white"
also, as you can see, once we press 1, 2, or 3, it puts or "echos" the color code in to the "ColorSave"
file, then when are batch file douse the "call" command for the color save, it reads the color code
and changes the color of the batch file
now by adding those two lines of code in are main file, we can change the color of it by just oping up the
menu, and it well auto save the color, so next time you open it, it well be the color. (or any color that you set)