Window 2000 command

Source: Internet
Author: User
Tags control characters perl script
1. Special location and position
The command line program is stored in the 32-bit System File warehouse -- win
2000 in the System32 subdirectory under the installation directory, we can see that the command line command of Win2000 is no longer a "small" of the system
Win2000 also listed them as the "main data center" by viewing the system32/dllcache directory.
A protected system file column is entered. Once the command line command in the System32 directory is damaged, the dllcache directory is used.
The backup in is restored immediately. Of course, because Win2000 is born out of WINNT, the main program called by the command line is no longer win9.
Command.comin the xera, which is the cmd.exe under nt.

2. Some commands can only be directly executed through the command line
For example, the system file scanner sfc.exe in win9xis a Windows-Style dialog box, and
You must manually enter the relevant parameters in the command line status to run the command as required.
Interface (1 ).
3. The usage of the command line window is different from that in the past.
① The copy and paste operations are different. In the window state, there is no longer a toolbar as in the DOS window of Win9x
As a result, many people find that copying and other operations cannot be performed in the Win2000 command line window. In fact, the Win2000 command line window
You can select, copy, and paste the window content, but the commands are hidden. Mouse over window
The direct operation of the interface content can only be selected, that is, when you press the left mouse button to drag the content will be reversed, if you press Ctrl
+ C command, you cannot copy the selected content to the clipboard. Instead, you must right-click the title bar of the window and select
"Edit", then you will see the menu about the copy, paste and other operation commands (2 ).
② You can view the content displayed on each operation screen before and after. This is not possible in the full screen status and must be used
The ALT + enter key switches to the window state. A scroll bar will appear on the right side of the window, and you can drag the scroll bar to any
However, if the operation shows too many results, the content that exceeds the memory buffer will follow the FIFO (first in first out
, First-in-first-out) principle is automatically discarded. After the CLS command is used, the screen and buffer content can be cleared at the same time.

4. added a large number of shortcut keys and powerful and convenient doskey-like functions
In the command line status of Win2000, the MEM/C command does not show signs of automatic doskey.exe command in the memory,
It does have very powerful functions similar to traditional doskey, such:
Pageup and Pagedown: Re-call the last two Commands
Repeated invocation: the commands are re-called one by one in sequence in historical commands;
Cursor →: move the cursor on the command line to edit the input command line;
Insert: Switch the insert and rewrite statuses of command line editing;
Home and end: Quickly move the cursor to the beginning or end of the command line;
Delete: Delete the character after the cursor;
Enter: copy the selected content in the window (replace Ctrl + C with the command );
F7: displays the list of historical commands. You can easily select commands that have been used from the list;
F9: Enter the command number function. You can directly enter the number of the historical command to use this command.
Others from F1 ~ The F9 keys define different functions.

5. Direct support for system mounted code table input methods
In the past, to display and enter Chinese characters at the doscommand prompt of Win9x, you must start the Chinese Input Method separately, such as pdos95.
Or UCDOS is used to display Chinese characters in the cmd.exe command line of win2000.
The UI is identical with the hotkey to directly call various code table input methods installed in the system, such as Ctrl + shift switching input.
Method, CTRL + space Switch Input Method switch, Shift + space switch full angle and half angle status, CTRL +. Switch between Chinese and English Punctuation
But the input method under the command line can only be input in the command line, for example, open an edit
Editor, the input method does not work, but it is a big pity!

6. add multiple internal commands
Color: Set the default console foreground and background color. We no longer need to envy the rich control of other operating systems
Color settings command!
Usage: Color [ATTR] Where ATTR is the color attribute output by the specified Console
The color attribute is specified by two hexadecimal numbers-the first is the background, and the second is the foreground. Each number can be
Is one of the following values:
If no parameter is specified, the command restores the color to the color when cmd. EXE is started. This value comes from the current
Console window,/t command line option, or defaultcolor registry value.
If you use the same foreground and background color to execute the color command, the color command sets errorlevel to 1.
For example, if "color FC" is highlighted in white, try to input a "color 02", haha ...... Your
The display on the screen turns to black and green.
Pushd: Save the current directory for use by the popd command and change it to the specified directory.
Usage: pushd [path |...] Where path is the directory specified to be the current directory.
If the command extension is enabled, in addition to the common drive letter and path, the pushd command also accepts the network path. If
After the network path is set, pushd will create a temporary drive letter pointing to the specified network resource, and then use the newly defined driver
Device number to change the current drive and directory. You can assign a temporary drive letter from Z: Down, using the first one found is useless
Drive letter.
Popd: Command Option to the directory saved in the pushd command.
If the command extension is enabled, the popd command deletes the temporary
Drive letter.
Setlocal: Start localization of Environment Changes in the batch file. Environment Change after setlocal is executed
The operation is limited to batch files. To restore the original settings, you must execute endlocal. When the end of the batch file is reached
For each unexecuted setlocal command of the batch processing file, an implicit endlocal is executed.
Assoc: display or modify file extension associations
Usage: assoc [. Ext [= [filetype]
. Ext specifies the file extension associated with the file type,
Filetype specifies the file type associated with the file extension.
Enter assoc without parameters to display the association of the current file. If you only use the file extension to call assoc,
File extensions. If no parameter is specified for the file type, the command deletes
Association.
For example:
Assoc. Pl = perlscript
FTYPE perlscript=perl.exe % 1% *
Enable the following Perl script:
Script. pl 1 2 3
If you do not want to enter an extension, type the following string:
Set pathext =. pl; % pathext %
The started script is as follows:
Script 1 2 3

7.20..exe more complex and powerful command line parameters
Cmd.exe has many command line parameters as follows:
CMD [/A |/u] [/q] [/d] [/E: On |/E: Off] [/F: On |/F: off] [/V: On |/V: Off] [
[/S] [/c |/K] string]
/C executes the specified command of the string and then interrupts it;
/K executes the specified string command but retains it;
/S modifies string processing after/C or/K;
/Q close the response;
/D stop executing the autorun command from the registry;
/A converts the output from an internal pipeline or file command to ANSI;
/U converts the output to an internal pipeline or file command to Unicode
/T: FG sets the foreground/background color (for details, see color /?);
/E: Enable command extension on;
/E: off stop command extension;
/F: Enable file and directory name completion characters on;
/F: off stop file and directory name completion character;
/V: On uses C as the separator to start the extension of delayed environment variables.
/V: Off disables delayed environment extension.
Note that if the string contains quotation marks, you can use multiple commands separated by the command separator. And
For compatibility reasons,/X is the same as/E: On,/Y is the same as/E: off, And/r is the same as/C. Ignore any other Command Options.
If/C or/K is specified, the remaining part of the command line after the command option is processed as the command line. In this case,
The following logic is used to process quotes ("):
(1) If all of the following conditions are met, the quotation marks on the command line will be retained:
Without the/s command option;
There are two full quotation marks;
There is no special character between two quotation marks, and the special character is one of the following: <> () @ ^ |;
There must be at least one blank character between two quotation marks;
There is at least one executable file name between two quotation marks.
(2) otherwise, the old method is to check whether the first character is a pair of quotation marks. If yes, remove the first character and delete it.
Aside from the last quote character on the command line, the text after the last quote character is retained. If/D is not on the command line
It is specified. When cmd. EXE starts, it will look for the following REG_SZ/reg_expand_sz registry variable. If one of
Or both exist. These two variables are executed first.
HKEY_LOCAL_MACHINE/software/Microsoft/command processor/Autorun
And
HKEY_CURRENT_USER/software/Microsoft/command processor/Autorun
Command extension is enabled by default. You can also use/E: off to disable the extension for a specific call. You can
You can use regedit32.exe to enable or disable all the calls of cmd.exe.
One or two REG_DWORD values in the registry:
HKEY_LOCAL_MACHINE/software/Microsoft/command processor/enableextensions
And
HKEY_CURRENT_USER/software/Microsoft/command processor/enableextensions to 0x1 or 0x
0. User-specific settings have priority over machine settings. Command Line Command Options have priority over registry settings.
Command line extensions include changes and additions to the following commands:
Del or erase, color, CD or chdir, MD or mkdir, prompt, pushd, popd, set, setlocal, end
Local, if, for, call, shift, Goto, start (including changes made to external command calls),
SOC and FTYPE.
For more information, type "HELP command name ".
Environment extension of delayed variables is not enabled by default. You can use the/V: On or/V: off command to specify
Call to enable or disable extended environment variable delay. You can enable or disable cmd on a machine or user login session.
For all calls to exe, you must configure one or two REG_DWORD in the registry of regedit32.exe.
Value:
HKEY_LOCAL_MACHINE/software/Microsoft/command processor/delayedexpansion
And
HKEY_CURRENT_USER/software/Microsoft/command processor/delayedexpansion to 0x1 or 0x
0. User-specific settings have priority over machine settings. Command Line Command Options have priority over registry settings.
If the extension of the delayed environment variable is enabled, the exclamation point character can be used to replace
Value.
The file and directory names are disabled by default. You can use the/F: On or/F: offcommand to specify
The file name is enabled or disabled. You can start or stop using cmd.exe on the machine or on the user's website.
After the call is completed, you must use one or two REG_DWORD values in the registry of regedit32.exe:
HKEY_LOCAL_MACHINE/software/Microsoft/command processor/completionchar
HKEY_LOCAL_MACHINE/software/Microsoft/command processor/pathcompletionchar
And
HKEY_CURRENT_USER/software/Microsoft/command processor/completionchar
HKEY_CURRENT_USER/software/Microsoft/command processor/pathcompletionchar
The hexadecimal value of a control character is used as a specific parameter (for example, 0x4 is Ctrl-D, 0x6 is Ctrl-f ).
User-specific settings take precedence over machine settings. The command line option takes precedence over registry settings.
If the/F: On command option is enabled, the two control operators to be used are: the directory name is complete with Ctrl-D,
Press ctrl-F to complete the file name. To disable a character in the registry, use a space (0x20) value because the character is not
Is the control character.
If you type one of the two control characters, the completion is called. The completion function takes the path character length to the left of the cursor
Edge. If no wildcard exists, append the wildcard to the left and create a list of matched paths. Then, the first phase is displayed.
Path. If no matching path exists, a beep will be made without affecting the display. Then, repeat the same control word
Returns a list of matched paths cyclically. Press the Shift key and control character at the same time, and the list is displayed backwards. If
This row is edited and the control character is pressed again. The list of saved paths will be discarded, and new ones will be generated.
. If the command option is executed between the file and the directory name, the same occurs. Unique zone between two control characters
These are not the file completion characters that match the file and directory names, but the directory completion characters only match the directory name. If the file is used
Built-in directory commands (Cd, MD, or RD) are completed using directories.
Enclose the quotation marks in a consistent path. After the code is completed, the file name containing spaces or other special characters can be correctly processed.
At the same time, if the backup is completed and the file is called in the row, the text on the right of the cursor is discarded.
Editor's note: I 've talked so much about it. I mainly introduced Microsoft's command extension and Path Extension in principle.
The functions to be completed are interesting and practical for most of our computer hobbies.
: // Www.microsoft.com, we know that since Windows NT 4.0, Windows has
The command line auto-completion function of the same UX does not believe that HKEY_LOCAL_MACHINE/software/Microsoft/comma
Change the key value of Nd prosessor/completionchar to 9, switch to the command line window, and enter cd c:/wind.
Click a tab and try again ...... The system automatically enters cd c:/Windows for you.
8. An interesting bug
In the command line (even in other graphic editor such as Word2000 !) After calling any Chinese Input Method
If you enter "……" once in the full-width and Chinese Punctuation (SHIFT + ^ can be input directly from the keyboard) and then
If you enter certain special characters in uppercase letters or press shift, a "…" is automatically added after each character.
Number, such as "W ..." , "% ..." I don't know what Microsoft's intention is to do this? I cannot think of the usefulness of this function,
It can only be interpreted as an insignificant bug.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.