Ratul was here

Setting a Custom Name for Windows Command Prompt

You can set a custom name for the Windows command prompt by using the "prompt" command followed by the desired name. Here's how to do it:

  1. Open the Command Prompt by pressing the Windows key + R on your keyboard, typing "cmd" and pressing Enter.
  2. Type "prompt" followed by the desired name enclosed in $G and $S characters. For example, to set the name to "MyPrompt", type:
   prompt $GMyPrompt$S
  1. Press Enter, and you'll see the new prompt name in the Command Prompt window.

You can customize the prompt further by using various codes, such as $D for the current date, $T for the current time, and $P for the current drive and path. For example, to include the current date and time in your prompt, you could use:

   prompt $D $T $GMyPrompt$S

This would display something like "Tue 03/30/2023 12:00:00 MyPrompt>".

Setting the Custom Name Permanently

To set the custom name permanently so that it appears every time you open the Command Prompt, you need to modify the Windows environment variables. Here's how to do it:

  1. Right-click the Start button and select System.
  2. Click on the "Advanced system settings" link on the left-hand side of the System window.
  3. In the System Properties window, click on the "Environment Variables" button.
  4. Under "User variables" or "System variables," locate the "Prompt" variable, and click "Edit."
  5. In the "Edit Environment Variable" window, replace the current value with the desired custom prompt name, enclosed in $G and $S characters.
  6. Click "OK" on all windows to close them and save the changes.

Once you have set the "Prompt" environment variable, the custom prompt name will appear every time you open the Command Prompt. If you ever want to change it, just follow the same steps and modify the "Prompt" variable again.

Creating a New Environment Variable

If you cannot find the "Prompt" variable in the Environment Variables window, it means that it hasn't been set yet. In this case, you can create a new environment variable to set the custom prompt name. Here's how to do it:

  1. Open the Command Prompt by pressing the Windows key + R on your keyboard, typing "cmd" and pressing Enter.
  2. Type "setx prompt" followed by the desired name enclosed in $G and $S characters. For example, to set the name to "MyPrompt", type:
   setx prompt $GMyPrompt$S
  1. Press Enter, and you'll see a message saying "SUCCESS: Specified value was saved."
  2. Close the Command Prompt window.

Now, every time you open the Command Prompt, the custom prompt name will be displayed. If you ever want to change it, just open a new Command Prompt window and repeat the above steps with the new custom prompt name.

#cmd #custom #prompt #windows