How To Change Color Of Command Prompt

5 min read

Introduction

Changing the color of the Command Prompt (CMD) not only personalizes your workflow but also helps reduce eye strain and improves readability, especially in low‑light environments. Whether you want a classic dark scheme or a vibrant theme, the process is straightforward and requires no external software. This guide walks you through how to change color of command prompt using built‑in Windows utilities, explains the underlying color codes, and answers common questions to ensure you can customize your terminal with confidence.

Steps to Change Command Prompt Color

1. Open the Command Prompt

  1. Run as Administrator – Press Win + X, select Windows PowerShell or Command Prompt from the menu, and choose Run as administrator. Using administrator rights ensures any changes to system‑wide settings are applied correctly.
  2. handle to Your Profile Folder – Type cd %USERPROFILE% and press Enter. This step is optional but useful if you plan to save a batch file for quick access.

2. Use the Built‑in color Command

The color command accepts a two‑character parameter: the first character sets the background color, and the second sets the foreground (text) color.

  • Syntax: color XY
  • Example: color 0A sets the background to black (0) and the text to bright green (A).

a. Choose Your Colors

Foreground Background Code
Black Black 00
Blue Blue 1B
Green Green 2C
Cyan Cyan 3D
Red Red 4E
Magenta Magenta 5F
Yellow Yellow 6G
White White 7H
Bright variants (8‑F) Bright variants (8‑F) 8‑F

You'll probably want to bookmark this section Most people skip this — try not to..

Tip: Use the bright variants (8‑F) for high‑contrast themes that are easier on the eyes during night sessions That's the part that actually makes a difference..

b. Apply the Change Immediately

Open a new Command Prompt window and type the desired command, for example:

color 1E

This will make the background blue (1) and the text bright red (E). The change takes effect instantly in the current window.

3. Save Your Preference with a Batch File

If you prefer a one‑click solution, create a batch file that runs the color command.

  1. Open Notepad and type:

    @echo off
    color 03
    

    Replace 03 with your chosen color code Easy to understand, harder to ignore..

  2. Save the file with a .bat extension, e.g., MyCmdColors.bat.

  3. Double‑click the batch file to launch a Command Prompt with the preset colors.

4. Modify the Default Color for All New Sessions

Windows allows you to set the default CMD color globally through the Registry.

  1. Press Win + R, type regedit, and press Enter.

  2. deal with to:

    HKEY_CURRENT_USER\Console\CRL_FONTS  
    
  3. Locate the entry named ColorTableXX (where XX ranges from 00 to EF). To give you an idea, ColorTable00 defines the black background, while ColorTable0F defines the bright white text.

  4. Double‑click the appropriate entry, change the DWORD (Hex) value to the desired RGB hex code (e.g., 000000 for pure black, FF0000 for red), and click OK And that's really what it comes down to..

Warning: Editing the Registry can affect other applications if done incorrectly. It is recommended to export a backup before making changes.

Scientific Explanation

How Console Colors Work

The Command Prompt color system is based on the ANSI escape code concept, although Windows CMD originally uses a simpler attribute system. When you execute color XY, Windows interprets the two hex digits as follows:

  • First digit (Background): Represents a color from the standard 8‑color palette (0‑7 for normal intensity, 8‑F for bright intensity).
  • Second digit (Foreground): Same palette for text color.

These values are stored in the console’s screen buffer and applied to each character cell. The underlying Windows API, SetConsoleTextAttribute, receives the combined attribute (background << 4 | foreground) and updates the display accordingly.

Understanding this binary mapping helps you predict the outcome of any color command and even combine it with other console attributes like bold (1) or underline (4) using extended escape sequences (\033[<attr>m). While these extended sequences are not directly supported by the color command, they can be sent via echo or printf for more advanced styling.

Frequently Asked Questions (FAQ)

Q1: Can I revert to the original colors?

A1: Yes. The default CMD colors are typically black background with white text (color 07). Run color 07 in a new window to restore them.

Q2: Why does the color change only in new windows?

A2: The color command modifies the current console session’s attributes. Existing open windows retain their original settings unless you re‑launch them with the batch file or a new color command.

Q3enity: Is it safe to edit the Registry?

A3: Editing the Registry is generally safe if you follow precise steps and keep a backup. Always export the relevant keys before modifying them.

Q4: Can I set different colors for PowerShell?

A4: PowerShell uses a different mechanism (the *ConsoleColor* enumeration). You can set colors via $Host.UI.RawUI.WindowTitle or by using Set-PSColor modules, but the color command is specific to CMD Not complicated — just consistent..

Q5: What if the color appears washed out?

A5: Washed‑out colors often result from using bright background/foreground combinations that clash. Try swapping the foreground and background codes or select muted tones like color 0A (black background, bright green text) Simple, but easy to overlook..

Conclusion

Customizing the Command Prompt color is a simple yet effective way to enhance your computing experience. Which means remember that the underlying color codes follow a predictable pattern, making experimentation straightforward. Practically speaking, by mastering the color XY command, creating batch files for quick access, and optionally tweaking the Registry for a system‑wide change, you can tailor the terminal’s appearance to suit your aesthetic and ergonomic preferences. With the steps and explanations provided, you now have everything needed to change color of command prompt confidently and keep your workflow both productive and visually appealing.

With the tools and techniques outlined, you can now personalize your console to match your workflow, improve readability, and reduce eye strain. Whether you choose the quick color command, a reusable batch file, or a system‑wide registry tweak, the possibilities are limited only by your imagination. Experiment with combinations, keep a backup of your settings, and enjoy a more vibrant command‑line experience.

Just Shared

Just Shared

You Might Find Useful

In the Same Vein

Thank you for reading about How To Change Color Of Command Prompt. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home