How can you get the default color value of the command prompt?
Do you have to read a registry key?
color
Moderator: DosItHelp
Re: color
yes®ᴱᵴᴲᴙᴠᴱᴆ wrote:How can you get the default color value of the command prompt?
Do you have to read a registry key?
Code: Select all
( %regKey.read_% $var, "HKLM\Software\Microsoft\Command Processor", "DefaultColor" )
( %regKey.read_% $var, "HKCU\Software\Microsoft\Command Processor", "DefaultColor" )
-
- Posts: 6
- Joined: 23 Aug 2012 10:17
Re: color
Thank you for the responses. When you change the console colors via properties the value still shows up as 0 in the registry. Unless the user has it specified in the registry as 0a, 0b, 0c ..... how do I obtain the hex value of console color not just 0 for default. Where is this data located?
Thanks
Thanks
Re: color
I think that the change of properties can find with the following XP command:
The standard of ScreenColor value is hex07.
background color = 0 = black
text color = 7 = light gray
To reset to standard value in the CMD window:
COLOR
or
COLOR 7
or
COLOR 07
Code: Select all
reg query "HKU\.DEFAULT\Console" /v "ScreenColors"
The standard of ScreenColor value is hex07.
background color = 0 = black
text color = 7 = light gray
To reset to standard value in the CMD window:
COLOR
or
COLOR 7
or
COLOR 07
Re: color
If you run the CMD command with short cut "Win + R" can you use the option "/t" to select the colors.
Without the option "/t" is used the color that is definated in "DefaultColor".
If the value in "DefaultColor" one of the following hex value: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
then is used the "ScreenColors". (background color and text color the same color)
When you use one of the values in COLOR then will not change the color and the ERRORLEVEL 1.
The standard value are:
"HKLM\Software\Microsoft\Command Processor"
DefaultColor=0x00000000 (0)
"HKU\.DEFAULT\Console"
ScreenColors=0x00000007 (7)
###
If you start the CMD command over a link (icon) and you change the properties than will save this possible in the link file.
Without the option "/t" is used the color that is definated in "DefaultColor".
If the value in "DefaultColor" one of the following hex value: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
then is used the "ScreenColors". (background color and text color the same color)
When you use one of the values in COLOR then will not change the color and the ERRORLEVEL 1.
The standard value are:
"HKLM\Software\Microsoft\Command Processor"
DefaultColor=0x00000000 (0)
"HKU\.DEFAULT\Console"
ScreenColors=0x00000007 (7)
###
If you start the CMD command over a link (icon) and you change the properties than will save this possible in the link file.
-
- Posts: 233
- Joined: 21 Nov 2010 08:07
- Location: At My Computer
Re: color
This is what works for me for text color from .reg file...
Code: Select all
;**Customize your dos text color, default is 0 (white) change text to green with the black standard background**
[HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
"DefaultColor"=dword:0000000a