3

I've imported a color scheme into my registry at HKEY_CURRENT_USER\Console

Now when I hit Windows Key + X, and go to Command Prompt (Admin) I see my nice color scheme.

If I navigate to cmd.exe and open it manually, I see my nice color scheme.

BUT, if I open up Windows Key + X, and go to Command Prompt (not admin) I see the lame old black and white colors... No nice scheme.

I tried to delete link file at C:\Users\...\AppData\Local\Microsoft\Windows\WinX\Group3 and re-create it by copying and modifying the Admin lnk, but still, no nice color scheme.

I've tried importing the colors to HKEY_CURRENT_USER/Software/Microsoft/Command Processor, too, with no luck.

I also tried opening the prompt and typing color (and COLOR)... No dice.

What's annoying is that if I click the logo in the top left, and click "Defaults" -- then I see the color scheme is in the settings... But it's not what is rendered in the terminal.

I tried rebooting, too.. No dice.

Does anyone know where else these colors might be coming from -- and why only from that one link?

4
  • If I navigate to cmd.exe Which one? There are two of them, under System32 and SysWow64 respectively. Also, I assume you looked at the subkeys of HKCU\Console as well, where per-app settings are saved, including colors.
    – dxiv
    Feb 15, 2016 at 0:44
  • Both cmd.exe's -- System32 and SysWow64 use the correct color scheme. The process is identical to what the link points to, but when started from the link the color is incorrect. I did look at subkeys -- there is no subkey for that <kbd>Windows key</kbd> + <kbd>X</kbd> link
    – tmsimont
    Feb 15, 2016 at 15:17
  • I tried to delete link file at C:\Users\...\AppData\Local\Microsoft\Windows\WinX\Group3 and re-create it Make sure to create a console app shortcut i.e. one which has the console options, including colors, available. If in doubt, you can copy the .lnk files from C:\Users\Default\AppData\Local\Microsoft\Windows\WinX\Group3 and edit the colors. Just tried it on Windows 10 and it works for me.
    – dxiv
    Feb 15, 2016 at 17:32
  • I tried that, by copying the Admin lnk. The behavior is crazy to me. It works as expected, but if I rename the new link to the old name, 02 - Command Prompt.lnk then it goes back to the stupid boring black/white colors... If I rename it back to 01-2 - Command Prompt.lnk, then I get my nice colors. I searched the entire registry for that name 02 - Command Prompt but couldn't find anything related to colors. I have a 32-bit ASUS and did not encounter this issue. This is on a 64 bit HP.
    – tmsimont
    Feb 15, 2016 at 23:23

2 Answers 2

6

This looks to be a change in Windows 10 vs. the behavior described by @JosefZ for Windows 8.x.

The 2 shortcuts executed for WinKey+X Command Prompt exist in the same place, with the same names (01 is the Admin one):

C:\>dir /b %LOCALAPPDATA%\Microsoft\Windows\WinX\Group3\*command*.*
01 - Command Prompt.lnk
02 - Command Prompt.lnk

However, running/customizing either WinKey+X Command Prompt no longer saves the console options to the HKCU\Console registry, but rather saves them (only) to the .lnk shortcut itself.

The solution in this case is to navigate in Windows Explorer to C:\Users\<user>\AppData\Local\Microsoft\Windows\WinX\Group3 and, for each of the two .lnk shortcuts, right click, select Properties, click the Colors tab and fix the colors. Or, simply replace the default .lnk shortcuts with a cmd shortcut that you have set to the right color scheme already.

5
  • Yes this is basically what I had to do. But what's really crazy is that somehow the name 02 - Command Prompt.lnk keeps an association to the old color scheme. So in addition to your answer, I have to rename the link, and then adjust the pointer to the link name in the LOCALAPPDATA%\Microsoft\Windows\WinX\Group3\.desktop.ini file
    – tmsimont
    Feb 15, 2016 at 23:25
  • Hmm I tried renaming it again and now it works with the original name! I did a search on the user>\AppData\Local\Microsoft\Windows directory for that name, and it turned up in user>\AppData\Local\Microsoft\Windows\.\Caches\{AFBF91A-.......}.....db -- I bet there was some association to the file name cached in that .db file.
    – tmsimont
    Feb 15, 2016 at 23:48
  • I have a .bat file that I use to quickly SSH. Turns out, similar to the .lnk files, all the Command Prompt Properties (not Defaults) that were configured in the Command Prompt, specific to that opening of the .bat file, got stored "in" the file itself. If I right-click on the file and go to its similarly named Properties, then there are tabs for things like Colours.
    – Cloud
    Jan 27, 2022 at 10:53
  • @Cloud The console preferences get saved in either the registry or the .lnk shortcut, though not in the .bat file itself. It's easy to verify that if you copy the batch file to a different machine, the configured properties do not carry over.
    – dxiv
    Jan 30, 2022 at 23:52
  • @dxiv Ah alright, then maybe it was buried somewhere in the registry as subkeys. Couldn't find it though, and those preferences were specific to that launching of the bat file under that name.
    – Cloud
    Feb 1, 2022 at 1:07
1

Values under HKEY_CURRENT_USER\Console store default command prompt settings. However, anyone can customize appearance of different command prompt windows launched from different shortcuts; settings are stored in subkeys of the HKCU\Console registry keys: see full description in console-window-name Technet article.
A particular subkey is updated when you change corresponding shortcut properties (tabs Options, Font, Layout and Colours). The same for currently open command prompt window properties (not defaults) on window top border right click.

Shortcuts for command prompt launched via WinKey+x could be found here: %LOCALAPPDATA%\Microsoft\Windows\WinX\Group3

For instance, on my Windows 8.1:

==> dir /B "%LOCALAPPDATA%\Microsoft\Windows\WinX\Group3"|find /i "Command"
01 - Command Prompt.lnk
02 - Command Prompt.lnk

==> reg query HKCU\Console |find /I "\Console" |find /V /I "PowerShell"
HKEY_CURRENT_USER\Console
HKEY_CURRENT_USER\Console\%SystemRoot%_System32_cmd.exe
HKEY_CURRENT_USER\Console\01 - Command Prompt
HKEY_CURRENT_USER\Console\02 - Command Prompt
HKEY_CURRENT_USER\Console\Command Prompt
HKEY_CURRENT_USER\Console\Command Prompt X

==>

Here individual HKCU\Console subkeys correspond to next command prompt shortcuts:

  • %SystemRoot%_System32_cmd.exe: WinKey+rcmd /D or (not sure) WinKeycmd
  • 01 - Command Prompt: WinKey+xCommand Prompt (Admin)
  • 02 - Command Prompt: WinKey+xCommand Prompt
  • Command Prompt: shortcut from Start menu search (WinKeyCommand Prompt) pinned to taskbar
  • Command Prompt X: special shortcut on my desktop.

Edit with respect to tmsimont's comment: maybe that there is a mistake in my pristine description and when you run a particular shortcut, then corresponding subkey is not created and defaults are used for launched command window…

However, a particular subkey of the HKCU\Console registry key is created/updated when you save changes to corresponding shortcut properties (tabs Options, Font, Layout and Colours). The same for currently open command prompt window properties (not defaults) on window top border right click.

1
  • 1
    I see subkeys, but not one for HKEY_CURRENT_USER\Console\02 - Command Prompt which would be the link that is acting up on me... I even tried deleting all of the keys and subkeys in HKEY_CURRENT_USER\Console, and then importing only my new color scheme. It still doesn't make this link work properly.
    – tmsimont
    Feb 15, 2016 at 15:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .