Reputation: 300
I have a custom color and background that I like on the cmd. However, It is only on one computer and I want to have the same color on about 30 computers. The process is slow as I would have to do it manually, and I want to do it with batch and I disk with an autorun file.
Can I make a batch file that will first display the rgb value of my text and background default and then set the batch file to use that color?
For example:
(find color values as cmdca)
set NewColor = %cmdca%
color %NewColor%
Obviously, this will not work. I am just trying to explain what it will do.
BTW:
Text color: 255r, 255g, 255b. (r=red/g=green/b=blue)
Background color: 1r, 1g,18b.
Upvotes: 2
Views: 344
Reputation: 300
This piece of code is a little tool that I made that will make it easier for the average computer user to import/ export the registry keys that hold the background and text color. First, the prompt will ask for the username. Then, it will ask if you want to import or export. From there, it will give an explanation of what each one will do. Then it will ask if the user wanted to use this or go back to the beginning to choose another option. Once they confirm, it will export or import based on the users decision
@ECHO Off
color c
title Magic Registry Import/export tool
cls
:prompt
SET /P users=What is your username? If there are spaces, please only type the part up to the space
SET /P userin=Import or export?
if /I "%userin%"=="import" goto import
if /I "%userin%"=="export" goto export
echo Try again. Please type either word: "export" "import"
goto prompt
:import
echo importing will make 2 files you exported in use.
echo Make sure your files are:
echo 1: On the Desktop,
echo 2: Named console1 and console2
SET /P yesorno2=Are you sure you want to continue? (Y/N)
if /I "%yesorno2%"=="y" goto import_y
if /I "%yesorno2%"=="n" goto prompt
echo Error
pause 10
exit
:export
echo exporting will send 2 files that hold your values.
SET /P yesorno1=Are you sure you want to continue? (Y/N)
if /I "%yesorno1%"=="y" goto export_y
if /I "%yesorno1%"=="n" goto prompt
echo Error
pause 10
exit
:import_y
cd C:\Users\%Users%\Desktop\
echo Now importing In 10 seconds
timeout 10
reg import console1.reg
reg import console2.reg
echo application complete. You may now exit.
timeout 10
exit
:export_y
echo Now exporting In 10 seconds
timeout 10
goto exp
:exp
cd C:\users\%users%\desktop
reg export HKEY_CURRENT_USER\Console console1.reg
reg export "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" console2.reg
echo application complete. You may now exit.
timeout 10
exit
Upvotes: 0
Reputation: 73686
The settings are stored in HKEY_CURRENT_USER\Console
(customizations for various console apps, including the RGB values for palette colors) and HKEY_CURRENT_USER\Software\Microsoft\Command Processor
(default parameters) so just export them and import on each machine.
Export:
reg export HKEY_CURRENT_USER\Console console1.reg /y
reg export "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" console2.reg /y
Import:
reg import "console1.reg"
reg import "console2.reg"
Upvotes: 2