How to bring the Command Prompt out of the dark ages

February 6, 2013 at 2:07 pm by

1,317 Total Views
cmd

Tips, Tweaks & Tricks – Command Console

Using a CMD (command) in the Command Console to quickly run a program, batch file, IPConfig query, or directory search has been with Windows for a very long time and doesn’t seem to have lost much of it’s usefulness. With the console and associated commands, it’s possible to run simple batch files and test them, run command line helper apps, etc. Although it’s useful and versatile, it’s appearance hasn’t changed much over the years. But, there are ways of bringing the simple CMD console out of the dark so it doesn’t look so, well, 1980′s.

To start the command console, in virtually all versions of windows, press the Windows key + R on your keyboard. The Run dialog box pops up. Type in CMD and the console will appear on your desktop. Once displayed, there are several settings we can change in order to improve the appearance and versatility of the command console. Though this article is written primarily for WinXP users, all of these settings are available (and more) in newer versions of Windows. But more on newer versions later.

Foremost on the dullness scale is its default of gray letters on a black background. Who isn’t tired of that?

First, make it more accessible. Click on Start, then All Programs, navigate to Accessories. To place on the desk top, right click on Command Prompt, then click on Send to then Create Desktop Shortcut. Once that’s done, and to add it to Quick Launch, check that Quick Launch is enabled (if it already is, there will be icons next to the Start button). If not, enable it by right clicking the taskbar, click on Properties and tick the box Show Quick Launch.Once Quick Launch is shown, either click and hold the CMD shortcut on the desktop and drop it on the left side of the taskbar or if the preference is to not have a desktop icon, return to the Command Prompt icon in Programs, click and hold and drop it in the Quick Start area of the task bar. Any unwanted icons in Quick Launch can be removed with a right click on the icon and selecting Delete. This only removes the icon, not the program.

Once Command Prompt is in Quick Launch or on the Desktop, just click it.

 

It doesn’t look very modern does it? And it’s not very pleasing to look at with that gray text on a black background. It’s easy to do something about that.

Click on the small icon in the title bar at the top left of the console. Select Properties. Below is a screen shot of the tab selections available, and by clicking the Colors tab, the screen displays the possible adjustments that can be made to the text and background colors.

 

Microsoft makes it easy to change colors. All that’s needed is to tick a radio button for the Screen Text or Screen Background. Then just click on a color in the color bar for the selected radio button and the result is shown in the Selected Screen Colors box. After choosing a favorite text and background color, click OK. Or check the other tabs for available options and tweaks first. For instance, on the Font page, setting the font to Lucida Console, and an appropriate Size gives an alternative to the default raster font. In newer versions of Windows, there are additional font types listed.

It may be desirable to adjust the size of the console when opened, and there are two ways; for the current session only, click the icon in the title bar and then click Size. Doing so allows click and hold of the lower right corner to size as needed. But this only allows the console to be narrowed, and/or lengthened based on the settings for window buffer size. To enlarge the console so when the program is opened it begins at a favored size, click the icon, then Properties. Then click the Layout tab. In the Window Size box, adjust the settings as desired. The defaults are 80, 25 for the Buffer size, and 80, 25 for the Window size. Changing to 200, 200, 80, 60 is suggested for most monitors. The reason for changing the Screen Buffer Size to 200, 200 is to cause both the scroll bars and the hold and drag bars at the bottom and side of the console to appear (in Win7 they are already present with the default setting). Then while using the console, there’s enough room in the buffer to drag the window wider, rather then just narrower. The most appropriate buffer settings depend on the specifics (resolution, width) of the monitor, and requirements of the job at hand. For instance, by setting the screen buffer size height at 2500, and typing DIR in System32 will allow scrolling back through ALL of the files in that directory. If it’s set at 500, then nearly 2000 of them scroll off screen.

Changing the window size to 80, 60 opens the window on startup to give a more appropriately sized work space to begin with. This is also the place to set the initial window position. Setting for 0,0 will put the window in the upper left corner of the screen whenever the program is opened. Or leave the default Let System position window box checked. Clicking and holding the console title bar will allow repositioning with ease. It’s possible to create several occurrences of cmd.exe and place them in Quick Launch where each is set to open in a different location, different font, or screen color.

On the Options page in Properties, verify the Command History buffer size is 10 or more. Or leave at the default of 50. And leaving the Command History Number of Buffers default at 4 keeps a history of 200 previous commands. This allows the use of the arrow keys to scroll through previously used commands so they can be repeated without retyping. Pressing the Up Arrow inserts the last command entered. Repeatedly pressing the up arrow key inserts each previous command entered in reverse order. Down arrow scrolls back down through the previously entered commands. Ticking the Discard Old Duplicates box does just as described. Pressing the Right Arrow inserts, one letter at a time, the previous command. This allows correcting an entry error. Left Arrow moves the cursor back over the command just typed, and if Insert Mode has been selected, allows inserting, if not, allows overwriting.

Once it’s set up in a favored way, click OK and a dialog box will appear that allows maintaining the settings for the current session only, or for whenever CMD console is opened.

Now that the CMD console window looks and works better, shortening the default path helps visibility when working in console, by shortening the displayed path. This makes the console more readable, by preventing those long lines where a command has been entered from wrapping around. Of course, just typing CD\ at the prompt in order to get to the root directory each time the console is opened works fine, but there is an easier, automatic way to do the same thing. To set it up for that, right click the CMD prompt icon in Quick Launch. Choose Properties. Under the Shortcut tab, it will look something like this:

 

Note that on this page it is possible to also set up Options, Colors, etc. Just like inside the command console. But here there are three other tabs, and to accomplish the current goal, click on the Shortcut tab. In Start in: the default is %HOMEDRIVE%%HOMEPATH%. Highlight that line and replace it with C:\ . Then whenever the console is opened, it will automatically start in C:\ rather then the default path.

While in properties, why not change the icon to something more interesting? Click on Change Icon… and then highlight the Look for Icons in this file path bar. Type in Shell32.dll. That will bring up tens of icons. Choose a favorite, click OK, and a different icon is installed.

It should be mentioned that there are open source efforts to give the CMD console a more pleasing and versatile GUI. The open source consoles that were tried did have some interesting features, such as tabbing (but it’s easy to open as many MS consoles as needed so tabs aren’t necessary), easy Cut & Paste, etc., but the most popular version (based on number of downloads) didn’t make it as easy to change colors. And some of them are more complicated then required for quick operations.

It is true that the Microsoft console Cut & Paste isn’t that intuitive in default mode, but it can be adjusted.

In the console, click on the icon at top left, choose Properties and click on the Options tab. Under the Edit Options header, check Quick Edit Mode. Click OK. Now to perform a copy, just highlight with the mouse as usual, and right click. That will put the text on the clipboard. Then use CTRL+V to paste it to any document. Microsoft’s instructions say to pressthe Shift key at the same time as the right click, but not all of Windows versions need that. To reverse the process and paste into console, navigate to the text to paste, highlight and copy it with CTRL+C, bring focus back to console, and at the C:\> prompt, just right click and the text is pasted. Insert mode, when checked, allows text to be pasted into a line, rather then overwriting it. This allows inserting a switch or long path into an existing command line. Autocomplete, when checked (accessed by clicking the icon and choosing Defaults), allows using the TAB key to cycle through the current directories files and folders. This is handy if writing several batch files and there is a need to run one after the other. Without Autocomplete checked, pressing the TAB key simply tabs the cursor on the command line. Autocomplete requires that the console be closed and reopened to change function.

Win7 has slightly different defaults, and to access properties just right click on Windows Command Processor in the Start menu if it has been pinned there or recently used, or navigate to Accessories. Right click and selected Properties. Here is a screen shot of all the extra tabs available in Win7 Command Processor Console:

 

The screen shot below shows the finished adjustments discussed above just after opening the program, with pleasing, easy to read coloring, a new icon, no wrap around, without the long path, and with ipconfig /? pasted in. For added usefulness, the scroll bars are present as is the sizing adjuster at the bottom right.

 

The power, simplicity and versatility of Microsoft’s command line console and command line processor is still appropriate for occasional use, favored by many IT pros, so why not give it some class by making these simple adjustments?

© 2013 techsupportforum.com

Filed under General, Software, Windows
Tagged .
  • Peter Piper

    In Vista and above if you want to open the command prompt in a certain folder, you can right click on that folder in windows explorer while holding down the shift key. Once the menu appears select “Open Command Window Here” and a command window will open in that folder.
    You can also do the same with network drives and Windows will map the next available drive for you and open the command window in that drive.