Sep 242013
 

Default Settings for Command Prompt

The default command prompt setting on Windows is pretty limited. Some limitation that I found while working on the command prompt is as follows…

  • Screen buffer size is very little. This means output of commands like ‘tree’ will not show up entirely in the command prompt. Once you scroll up you’ll not see the whole text. As a workaround you’ll have to redirect output to a text file.
  • Same with horizontal text, the text wraps around once the text touches the horizontal screen limit. I find this behavior annoying since this reduces readability.
  • Color is black and white. Its always cool to have different colors. I normally have dark red as background and white as foreground color.
  • Window size is limited. When you maximize command prompt it will only take half the screen size horizontally.
  • Its so painful to copy and paste. I want this feature to behave as in text editors like notepad. For e.g. just drag to select, instead of right clicking and selecting the “Mark” option.

After Customization of Command Prompt

Its very easy to customize our good old command prompt so that it stores more text vertically as well as horizontally. We can easily give good colors, better height and width etc. After customization this is how my command prompt looks in normal mode.

Command Prompt

Keep an eye on the scrollbar. The scrollbar thumbs are very small in size meaning they can scroll a lot more, which means more text. If you maximize the command prompt it occupies the entire screen as well.

Command Prompt Full Screen

If you look at the above output and the vertical scrollbar, I still have lots of screen buffer. If I scroll up I still see the command’s entire output. Isn’t this cool.

Copying and pasting is easy as well. Drag to select, right click on the selected area to copy and right click again to paste Smile. LOL that’s real cool. The selection is a free selection, always selects as a rectangle. See screenshot below…

Command Prompt with Selected Text

How to Customize Command Prompt

The whole customization lies in the command prompt’s system menu. Click on the dark icon at the far left corner, i.e. the system icon, of command prompt, select “Properties”. You should see a properties dialog popup.

To customize selection, copy, paste behavior check the “Quick edit” checkbox…

Command Prompt Properties Dialog: Options

To customize Font select appropriate fonts on the “Font” tab. This is how mine looks.

Command Prompt Properties Dialog: Font

To customize color, select appropriate colors in the “Colors” tab. This is how mine looks…

Command Prompt Properties Dialog: Colors

Please note there is a screen background and a popup background. Also there is a “Screen Text” and “Popup Text”. Screens stands for command prompt background, while popup stands for popup command dialogs, for e.g. press F7, the command history ‘popup’ window pops up…

Command Prompt Popup Dialog

Now comes my favorite, increasing the screen buffer size, or increasing the text buffer size of command prompt. This setting controls how much text the command prompt can hold. Please select the layout tab in the command prompt..

Command Prompt Properties Dialog: Layout

I’ve set the “Screen buffer Size” field values to high values so that it can hold as much text as possible. You can set your own values based on your preferences.

Hope this helps you in some way. Smile

Feb 092012
 

To gather system information of a computer running windows use the command ‘SystemInfo’. The command gathers following information…

1. Operating system information
2. Processor information
3. Input local information
4. Installed hotfix information
5. Network card information

A good way to use this command is to redirect output to a file, for e.g. SystemInfo > D:\SystemInfo.txt. Another option is to run it straight from "Start->Run->cmd /c systeminfo > D:\nibu.txt"

Good for creating repro’s, VM’s and to know what hotfixes are installed on the machine.

To get help on the command use: SystemInfo /?

Nov 222008
 

Ever wondered how we can generate random numbers in a batch file. Yes, I am talking about our good old faithful friend ‘.bat’ file. Why do I need one? You may ask! I had to generate a unique filename everytime because I had to backup a folder before I updated it.

So tell us is there one? Yes use ‘random’, it’s a built in command which generates a random number when you invoke it. Every time a unique one! So if you type in ‘random’ at a command line and then press enter, you’ll get an error because it’s not an independent executable, but a feature that is built into command prompt to help generate random numbers. So how will I get a random number? This is how I do it…

echo %random%

Make a random directory….

mkdir C:\Nibu_%random%

If Command Extensions are enabled, then there are several dynamic environment variables that can be expanded but which don’t show up in the list of variables displayed by SET.  These variable values are
computed dynamically each time the value of the variable is expanded. If the user explicitly defines a variable with one of these names, then that definition will override dynamic ones like %random%.

For more information type “set /?”

To enable command extensions open up regedit and then navigate to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\EnableExtensions
or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions

and set value to 1. If not present then add one REG_DWORD value with an identical name and value set to 1.

Jun 082007
 

Windows Tricks  and Tips

Windows Explorer Tips and Tricks
  • Shift + Click — on any hyperlink to open it in a new window.
  • Ctrl + + — Resize any list control to it’s contents.
  • *  — Expand any tree node and all it’s sub nodes in windows.
  • + — Expand any tree node
  • –  — Collapse any tree node
  • Shift + Click — on any folder inside explorer to open it in a new window with explorer bar at it’s side showing the path leading to that folder.
  • Shift + Enter – Does the same as above
  • Ctrl + Enter will open any folder in a new window
  • Ctrl + Double Click will open any folder in a new window
  • Ctrl + Double click on any explorer title bar including internal explorer to see that window in full screen mode.
  • Alt + Drag to select in columns.
  • Ctrl + Shift + F8 to do the above using keyboard.
  • WinKey + L to lock the desktop
  • Alt + Enter on any file to view it’s property pages.
  • Alt + Double Click on any folder to open it’s property pages.
  • Alt + Spacebar to open System menu of any window
  • Alt + – to open system menu of main child windows, for eg: Word document windows
  • Shift + Close button ( On caption bar ) to close all parent windows of a child explorer window at once.
  • Winkey + D — Show desktop
  • Winkey + M — Minimize all
  • Winkey + Shift + M — Undo Minimize All
  • WinKey + R — Opens run dialog
  • Winkey + E — Opens explorer
  • Winkey + U — Opens Utility manager
  • Winkey — Opens start menu