Although Windows 2000 is a GUI-driven operating system, there are times when it's quicker and easier to fire up a character-mode CMD command interpreter (click Start-Run and type cmd in the dialogue box).
The CMD CLI (command line interface) in Windows 2000 is much cleverer than the DOS box of Windows 98/Me, but it's documented in an unexpected place; to see the detailed online help, type:
This shows you the different switches and some of the settings options. Note that the CMD command interpreter isn't the same as the DOS COMMAND.COM interpreter; to load the latter, type command (followed by /? if you wish to see the switches you can pass to it).
The first thing you should do is to enable file and path name completion, as Windows 2000 uses long paths and file names. You can either start CMD with the /f:on switch (create a shortcut to CMD.EXE with that switch to save time), or enable it permanently in the Registry. For the latter, start Regedit and drill down to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command ProcessorLook for these two REG_DWORD values, or create them if they don't exist:
The default hexadecimal values for the ASCII key codes are:
0x4 (Ctrl-D) for file name completion
0x6 (Ctrl-F) for path name completion
The CMD file and path name completion also supports the asterisk (*) wildcard. Typing:
drops you in:
Next, let's snazz up the look of the CMD window a bit. Tweak the default small size and blocky font of the window by clicking on the little icon in the top left-hand corner and selecting Properties. Unfortunately, there are quite strict restrictions on "the fonts you can use for "CMD: it has to be a fixed-pitch, non-italic font (OEM_CHARSET), and if it's a TrueType one, it must be a Modern font face, which is monospaced and sans serif.
Adding fonts to the CMD console is a chore. Start Regedit, and go to:
HKLM\Software\Microsoft\Windows"NT\CurrentVersion\Console\TrueType"FontAdd a REG_SZ string value; you'll probably have the first font there, named "0", so call the next one "1" and as the data, enter the font name. No quotes anywhere, of course.
Then, set the window size under the Layout tab to a value that's right for your monitor resolution.
You can also set the Screen Buffer Size (i.e., the number of characters stored per line and the number of lines stored in the buffer) under the Layout tab, as well as the window position when you start up CMD.
The Options tab allows you to change the cursor size and the Command History buffer size; keep the QuickEdit (allows you to use the mouse to select text in the window) and Insert Modes (new text won't overwrite existing text). CMD is more useful in windowed than full-screen mode, so keep that default, too.
The Colors tab lets you change the colours of the CMD window.
Changing the prompt is easily done with the built-in "prompt" command.
Here's the list of prompt codes that you can use:
$A & (Ampersand).
$B | (pipe).
$C ( (Left parenthesis).
$D Current date.
$E Escape code (ASCII code 27).
$F ) (Right parenthesis).
$G > (greater-than sign).
$H Backspace (erases previous character).
$L < (less-than sign).
$N Current drive.
$P Current drive and path.
$Q = (equal sign).
$T Current time.
$V Windows XP version number.
$_ Carriage return and linefeed.
$$ $ (dollar sign).
embellishes your prompt with the current drive and path, the date and time, as well as the > sign, separated by spaces.
The CMD interpreter recognises files with .bat, .com, .exe and .cmd as executables. It will also run the registered application for a file, if you type its name from the command prompt.
If you want further control over how a program should execute, use the built-in "start" command. This runs a specified program in a separate window, and you can set lots of options such as the execution priority, give 16-bit programs separate or shared memory space and more; you can even use start to open up Explorer windows, bypassing the directory name. nHotkeys for CMDUp and Down arrow keys - cycle through the command buffer.
[Function, or F keys]:
F1 - letter-by-letter recall of the last command.
F2 - copy the command line until specified character.
F3 - recall the last command.
F4 - delete the command line until specified character.
F6 - Ctrl-Z, or Windows End Of File character.
F7 - view the command buffer, and select from it.
F8 - cycle forwards through the command buffer.
F9 - recall a command from the buffer with its number.
Ctrl-C or Ctrl-BREAK - interrupt program execution.
Ctrl-G - system bell.
Ctrl-H - backspace.
Ctrl-I - cycle forwards through the command buffer.
Ctrl-S - suspend execution.
Ctrl-M - new line.
Ctrl-Z - end of file; write out contents of buffer and close file.
Ctrl-Shift-@ - More? prompt.