Customizing Command Prompt

Well many times this happens that we want to work with the command prompt. Sometimes we wanna work with many CLI (command line interface). We usually SET the %PATH% variable of system or specific user for this. Things get really worse when we wanna work with more them one version of same Application/Compiler/System. We can’t set the variable as all have similar directory structure and almost same binary/executable names.

There are three ways out from this:

  • Set all the paths and change names of binaries
    (stupid. You would have to remember all names until you use some uniform naming method still you will keep guessing).
  • Create many users and set different user paths
    (Foolish. Then changing version will be like logging as different user).
  • Use a Customized Command Prompt
    (Elegant. Its like some developers are working)

How to Customize Command Prompt.

Well it involves 1,000 steps:-) no it doesn’t it involves 2 steps only.

  1. Create a file Called YOURSYSTEM-VER-cofig.bat. Where YOURSYSTEM is the name of the system you are using and VER is the version of that specific system like python-2.6-config.bat.
  2. Now put some codes in the file. Like:
  3. @ECHO OFF
    @SET PATH= %PATH%;C:\appand\your\path\here;D:\appand\one\more
    @SET SOMEVARABLE=E:\some\path
    @SET DIRCMD=/D /N
    @PROMPT $G
    @ECHO Setting environment for YOURSYSTEM VER
    @ECHO %TIME% %DATE%
    @ECHO Namaskar Criss.

  4. Then create a new shortcut Right click on empty space or File -> New -> Shortcut.
Create new shortcut

Create new shortcut

Then type %COMPSPEC% /K "C:\path\to\your\file" in it

shortcut

Creating shortcut

Then Rename the shortcut to a proper name.

Rename shorcut to a Proper name

Rename shorcut to a Proper name

Then click on Finish. Now Right click on the shortcut.

Command prompt shortcut

Command prompt shortcut

Select shortcut properties.

Shortcut properties

Shortcut properties

We can set the Fonts of the Command prompt.

Shortcut properties.

Shortcut properties.

We can set the color of the command prompt. like BACKGROUND, FOREGROUND.

Shortcut properties

Shortcut properties

We can even set the buffer and the screen layout of the shell window.

Shorcut properties

Shortcut properties

Example.

Costomized command prompt

Customized command prompt

Now you are ready to enjoy this very good feature.

I recommend you to keep all these files in one folder say with name config-all and with attribute as hidden.

About Shishir Sharma 'criss'

Shishir is a hacker, software developer and a bachelor of electronics & communication engineering. He is a problem solver, enthusiastic for technologies. He can speak in Java, Python, Perl, PHP, Curl etc; Fluent in C, C++, GNU/Linux. He is moderator at LUG-Jaipur and contributor of wordMint. He loves action movies and Counter Strike.
This entry was posted in Customization and tagged , , , , , . Bookmark the permalink.

One Response to Customizing Command Prompt

  1. Yagraj says:

    hey! good article shishir.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>