How to Create a Custom Windows Command Prompt

Command prompts (Windows) are cool because you can use them to perform various tasks, using the library of commands in c:\windows\system32\cmd.exe. You can change the look/feel of your Command Prompt (CMD prompt) in several ways: Change the size/shape of the window and text. Change the background and cursor colors. Change the flashing prompt to a custom message, including the date & time.

Steps

Decide whether you want to:
  • Change look/feel for a single cmd prompt/batch file,
  • Change properties for all command prompts (default behavior).
Get ready to change some Windows settings Change the Look & Feel Select or Create the shortcut/batch file for which you wish to change properties. If you select an existing batch file (*.bat), type a single command ("pause") into a new first line. For extra security (maybe there's commands in there you DON'T want to run), REM out the rest of the contents (put REM <space> at the start of each line). If you create an empty batch file (*.bat), type a single command ("pause") in it. When you run the batch file, it doesn't just exit immediately, allowing you to change it's settings. you could also go to notepad, type "command.com" and save it as cmd.bat
  1. Run the Command Prompt/batch file
  2. Click on the Command Prompt's system button (that's the little icon showing "C:\" at the top-left of the window, right opposite the window's "X" closure button). You get a command menu.
  3. To change settings for this Command Prompt window only, open <properties> on the command menu, you can change lots of look/feel settings.
  4. To change default settings for all Command Prompt windows, open <defaults> on the command menu, you can change lots of look/feel settings.
Change the Prompt
  • When you start a Command Box in Windows, it will display a prompt where you can enter the command to be executed.
However, you can easily configure this prompt:
  1. Open a Command Prompt to test your new Prompt.
  2. Copy this new prompt below and paste it in (right-click <paste>):prompt $_Hello Chaps$_$t$_$d$_$_[%computername%] $p$g
  3. Press <Enter>.
  4. See the new prompt that gives you!
  5. Modify the string to make the text more "yours". Test the modified prompt.
  6. When happy, prepare to modify your computer settings. This will change default Prompt behavior.
Set your Prompt as default
  • These settings require a registry change.
  1. Run your registry editor (click <Start><Run> and type "regedt32.exe".
  2. Navigate to the following key:→ HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Prompt
  3. Change the <Prompt> key to the following (or use your own string).prompt $_[%computername%]$_$t$_$d$_$_$p$g
  4. Restart your computer to complete registering of your new prompt.
  • To reset your prompt to windows default, clear the above key of all data.

Tips

The prompt by default is "$P$G" which simply means "Display the current drive and path" ($P) followed by a ">" sign ($G), for example ("C:\Windows>").
  • Acceptable values are:
  1. $N Current drive
  2. $P Current drive and path
  3. $T Current time (HH:MM:SS.mm)
  4. $D Current date
  5. $V Windows version number
  6. $H Deletes the previous character
  7. $G >
  8. $L <
  9. $C (
  10. $F )
  11. $S (space)
  12. $_ (Causes a CR/LF; new line)
  13. [%computername%] Your Computer Name in between brackets
  14.  %name_of_environment_varible% displays the value of the environment variable

Article provided by wikiHow, a wiki how-to manual. Please edit this article and find author credits at the original wikiHow article on How to Create a Custom Windows Command Prompt. All content on wikiHow can be shared under a Creative Commons license.


Topics: 
Advertising Construction Health Legal
Business Services Education Home Services Real Estate
Careers & Work Family Insurance Software
Cars Financial Services Internet Telecommunications
Computing & Technology