This is a very useful tip for anyone who regularly uses the Windows command line. The default cmd.exe prompt displays the current path on the same line that is used for input. When you are in a deep directory you don’t get much room for typing. The other problem is that the default prompt has a “>” symbol directly after the path which causes a problem when cut and pasting the current path into other windows.
You can have an improved command prompt like this:
The quick way to test this change is to enter this command at the prompt: “set prompt=$C$S$P$S$F$_$+$G$S”. The improved prompt will be enabled in the current window until it is closed.
To make the change permanent and enabled in all new cmd.exe windows:
- Windows Key + R.
- Type “sysdm.cpl” and press enter.
- Select the Advanced tab.
- Click “Environment Variables”.
- Click “New” to add a new user variable.
- Add variable name: PROMPT
- Add this value: $C$S$P$S$F$_$+$G$S
- Exit out of everything.
Now every cmd.exe window that you open will have the enhanced prompt. This gives you some benefits:
- More room to type your command.
- Separation between the current directory and the typed command.
- Double click on the current directory and paste and you have a valid path without modification.
#1 by Phil Skversky on July 22, 2008 - 12:19 pm
I have a shortcut on my QuickLaunch to open a command window. Properties are:
%SystemRoot%\system32\cmd.exe
It opens a window the full height of my screen.
However when I click Start > Run > cmd the window that opens is normal sized.
Why the difference, and how can I fix the shortcut on the QuickLaunch bar?
Thanks!
Phil
#2 by Patrick on July 23, 2008 - 7:07 pm
Phil,
The QuickLaunch shortcut probably has some custom settings set in the shortcut. When you use the Run box to launch cmd.exe the custom settings don’t get used so the window is the default size. To fix the QuickLaunch shortcut try this:
Right click on the shortcut to bring up the Properties dialog. There are a few things that you can check. On the Shortcut tab check the Run drop down and ensure that Normal Window is selected. You might have Maximize selected instead. Also check the Layout tab and check the Width/Height values. Try setting them to 80/25 which is the default.
Post back here and let me know if these tips work or not. Thanks.
#3 by Phil Skversky on July 31, 2008 - 6:01 am
Yes, Patrick, your suggestion for the Layout tab worked. (The Run dropdown was already set to Normal Window.)
Thanks!
Phil