Introduction: Customizable Command Prompt
Disclaimer: The original concept and the basic code behind this was created by Tuxmascot. However, I have slightly modified the code to make the code more versatile as well as adding my own little flair to it.
Have you ever wanted to use the Command Prompt, but the computer you were on had it locked? Or maybe you want the Command Prompt to have a certain color, but always get tired of having to set it when you start it. Whatever your reason, we've all wished that instead of using the standard Command Prompt, we could just make our own. Well no more! Today, I present you the solution to your problem. I give you an easily customizable program that does everything that the Command Prompt does, only it's more versatile!
Step 1: Things You Will Need
Although this program is fairly simple to make, it will take some things to make:
1. A Windows computer.
2. A basic understanding of batch files and how to make them.
3. A need for customization.
4. A spark of creativity.
Step 2: The Basic Code
Something you must understand about this program is that there are to parts of the code; Layers, if you will. The first layer is the basic layer. This is the bare minimum required to have a functional program. The second layer will be talked about in the next step.
The basic code behind this program is as follows:
set /p input=
What this code does is ask the user for input, then execute the input. So it is very important that anything put as input is in the batch language. Anything else will cause an error message. Another important thing to remember is that all of this is necessary to the program. Any fooling around with this code will cause the program to run improperly.
Step 3: The Complex Code
The second layer of the code is the complex layer. This is all the code that gives the program its true purpose. The basic layer makes this functional, but the complex layer makes this excellent. The problem with documenting the complex layer is that it is all very personal with what you do with the complex layer. You can add all sorts of things to your complex layer. An example might be programming it to greet you when you open the program, or perhaps telling you the time.
An example of the complex layer:
title Command Prompt
set /p input=Command:
This is where an understanding of batch programming really comes in handy. If you know a lot about batch, you can do a limitless amount of things with this custom Command Prompt. Here are a list of ideas to get you thinking:
1. Having the cls command as the program starts up -- When the program starts, you will notice a little message showing that echo is turned off. This is quite ugly looking and frankly, we could all do without it. So put that little command there and get rid of it before you even see it.
2. Having a title -- The default title for the program is C:\Windows\system32\cmd.exe. A real Command Prompt, though, has the title of Command Prompt. For people going for a realistic program, setting the title to be this is quite effective. If you're going for just a personal touch, perhaps naming it My Command Prompt.
3. Add a greeting message -- I know that I like it when my computer says things personally to me. So why shouldn't my command prompt greet me when I open it up? After all, it is my Command Prompt. I should be able to have it say whatever I want it to say to me. Also, adding a greeting makes the Command Prompt feel more like it's your own personal creation.
4. Changing the default color -- Haven't you ever wished that the Command Prompt automatically displayed your favorite colors when you opened it up? But having to change it every time is so annoying. But putting the color before the :command label is really simple and it doesn't affect how the rest of the colors work, should you choose to change to another color mid-session.
5. Change the prompt -- Don't you wish that stupid little prompt would go away? After all, if you needed to know the path you were currently on, you can just type cd. And having to change it every time you enter the command prompt is really annoying. But by simply adding a few words after "set /p input=" you can have the computer show you whatever you want right before you type something in.