The correct way to permanently set the colors (and other parameters) of a console/command-prompt is to:
- Open a command-prompt
- Right-click the titlebar or press Alt+Space
- Select Defaults from the context-menu
- Set the properties you would like (colors on the Colors tab)
- Click OK
The method that Tapped-Out gave works because Windows 7 happens to have a bug where the Properties option modifies the default values instead of just for the current console, and it could be fixed at any time.
The method that Indrek gave works as well, but using the provided interface is easier (and safer) than manually editing the registry, especially when setting the colors since you don’t have to mess around with hexadecimal values. Also, you don’t have to worry about setting permissions with the interface.
Finally, a word of warning. Each console type gets its own set of parameters, as does each shortcut to a console. In other words, if you create a shortcut to a console, changing the parameters will modify the shortcut and apply only to the console opened by the shortcut, not via other shortcuts or means. Also, if you run a console application and modify the parameters, they will be applied only to that console application and not to other consoles such as the command-prompt.
To clarify, what happens is that all consoles (command-prompts and console apps) use the default settings (stored in HKCU\Console) until they are specifically changed, at which point they will make a copy of those settings and use those from then on. For example, if you open edit.com, it will initially use the settings in HKCU\Console, but if you make changes to it, a copy will be made to HKCU\Console\c:windows_system32_edit.com, and changes to the defaults will no longer be reflected because settings specific to command.com exist (and override the defaults). This is similar to how user settings override system settings (e.g. HKCU overrides HKLM defaults).
HKCU\Console. Command-line VIM is a console app and so uses the console subsystem, so when it runs CSRSS gives it the default settings from there just like any other console app. If you change the settings for VIM, it will use those instead. If you make a shortcut to VIM, you can change the settings for just that shortcut and have VIM use the defaults when launched in other ways. You can even make several shortcuts, each with their own settings. – Synetech May 27 '12 at 12:49vim filenamecommand in cmd, VIM console is launched. I am talking about this console which is using color scheme from cmd shortcut. – user79032 May 29 '12 at 02:41dir, it will print blue on green (dirdoes not know, use, or care about the current colors). If you run another program that prints some stuff to the screen, it will also print blue on green. – Synetech May 29 '12 at 17:53dircommand.. Its a console. Explain it: When I change color scheme of VIM console, the changes aren't reflected back to cmd. Why? – user79032 May 29 '12 at 18:00:q. You can see what I have just said. – user79032 May 29 '12 at 18:05printfto send some text to the screen, the console subsystem receives theprintffunction and prints the text in whatever colors are the currently selected ones. If you change the colors, VIM still doesn’t know anything about it; the console does and redraws the screen with the new colors and prints new text in that color. – Synetech May 30 '12 at 08:18dir. It will print in whatever the current colors are. Now change the colors and you’ll see that the console window changes, and if you do anotherdir, it will be in the new ones.dirhas nothing to do with color (unlikels), so it only sends text to screen, not colors. In fact, there is not any practical way to even find out about the active colors of the console; a (Windows API/console-aware) program can only set the colors, not read them. – Synetech May 30 '12 at 08:23SetConsoleTextAttributefunction which sets the default colors for the console and all subsequent text, but most programs don't use that, they use the basic one.) Think of it as though there is aprintf(str)function that prints simple text in the current colors,printfc(str,fore,back)that prints text with the specified colors,setcolors(fore, back)that affects new next from just the program, andsetconcolors(fore,back)that sets the colors for the whole console. – Synetech May 30 '12 at 16:57