Cmd.exe _ parameter_start Parameter

Source: Internet
Author: User
Start the command to explain the new example of program Cmd.exe. If this parameter is not included, CmdThe version and copyright of the operating system are displayed. Syntax

Cmd[{/C|/K}] [/S] [/Q] [/D] [{/|/U}] [/T:FG] [/E:{On|Off}] [/F:{On|Off}] [/V:{On|Off}] [String]

Parameters

/C

RunStringCommand, and then stop.

/K

RunStringSpecify the command and continue.

/S

Modify/COr/KAfterString.

/Q

Disable echo.

/D

Disable AutoRun command execution.

/

Format the Internal Command output as a pipe or file by the American National Institute of Standards (ANSI.

/U

Format the Internal Command output as Unicode as a pipe or file.

/T:FG

Set foregroundFColor and backgroundGColor. The following table lists availableFAndGValid hexadecimal number of the value.

Value Color

0

Black

1

Blue

2

Green

3

Light Green

4

Red

5

Purple

6

Yellow

7

White

8

Gray

9

Light blue

A

Light Green

B

Light Green

C

Light red

D

Lavender

E

Pale yellow

F

Bright White

/E: on

Enable command extension.

/E: off

Disable command extension.

/F: on

File and directory name enabled.

/F: off

The file and directory name are disabled.

/V: on

Enable delayed environment variable extension.

/V: off

Disable extended environment variables.

String

Specifies the command to be executed.

/?

Display help at a command prompt.

Note

Use multiple commands

You canStringUsing the command Separator&&Separate multiple commands, but these commands must be enclosed in quotation marks (for example,"Command&&Command&&Command").

Process quotation marks

If/COr/K,CmdYesStringAnd keep quotation marks only when all of the following conditions are met:

Unused/S.

A pair of quotation marks is used accurately.

No special characters (for example, & <> () @ ^ |) are used in quotation marks ).

One or more white spaces are used in quotation marks.

Enclosed in quotation marksStringThe name of the executable file.

If the preceding conditions cannot be metStringFirst, check its first character to verify whether it is a left quotation mark. If the first character is left quotation marks, it will be separated from the right quotation marks. Any text that follows the right quotation mark will be retained.

Execute the Registry subitem

IfStringNot Specified/D, Cmd.exe looks for the following registry subkeys:

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Command Processor \ AutoRun \ REG_SZ

HKEY_CURRENT_USER \ Software \ Microsoft \ Command Processor \ AutoRun \ REG_EXPAND_SZ

If one or both of the preceding registry subkeys exist, they are executed before all other variables are executed.

Warning

Improper registry editing may seriously damage your system. Back up any valuable data on the computer before changing the registry.

Enable and disable command Extension

In Windows XP, command extension is enabled by default. For specific processes, you can use/E: offDisable them. Set the followingREG_DWORDValue, which can be enabled or disabled on the computer or user sessionCmdExtension of command line options:

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Command Processor \ EnableExtensions \ REG_DWORD

HKEY_CURRENT_USER \ Software \ Microsoft \ Command Processor \ EnableExtensions \ REG_DWORD

You can use Regedit.exe in the RegistryREG_DWORDSet the value0 × 1(Enabled) or0 × 0(Disabled ). User-specific settings take precedence over computer settings, and command line options take precedence over registry settings.

Warning

Improper registry editing may seriously damage your system. Back up any valuable data on the computer before changing the registry.

After the command extension is enabled, the following commands are affected:

Assoc

Call

Chdir(Cd)

Color

Del(Erase)

Endlocal

For

Ftype

Goto

If

Mkdir(Md)

Popd

Prompt

Pushd

Set

Setlocal

Shift

Start(This also includes the process of changing external commands)

For more information about these commands, see related topics ".

Enable delayed environment variable extension

If you enable extended delayed environment variables, you can use exclamation points to replace the runtime environment variable values.

File and directory name Enabled

By default, the file and directory names are disabled. For specificCmdCommand processing, you can use/F:{On|OffTo enable or disable the file name. Set the followingREG_DWORDValue. You can enable or disable allCmdThe name of the file and directory processed by the command is complete:

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Command Processor \ CompletionChar \ REG_DWORD

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Command Processor \ PathCompletionChar \ REG_DWORD

HKEY_CURRENT_USER \ Software \ Microsoft \ Command Processor \ CompletionChar \ REG_DWORD

HKEY_CURRENT_USER \ Software \ Microsoft \ Command Processor \ PathCompletionChar \ REG_DWORD

To setREG_DWORDValue. Run Regedit.exe and use the hexadecimal value of the control characters of the specific function (for example0 × 9Indicates the Tab key.0 × 08Indicates the BackSpace key ). User-specific settings take precedence over computer settings, and command line options take precedence over registry settings.

Warning

Improper registry editing may seriously damage your system. Back up any valuable data on the computer before changing the registry.

If you use/F: onIf the file name and directory name are enabled, Ctrl + D can be used for the directory name, and Ctrl + F can be used for the file name. To disable specific completion characters in the registry, use a space [0 × 20], Because space is not a valid control character.

Press Ctrl + D or Ctrl + F,CmdWill process the file and directory name to complete the operation. These keys are used inStringAppend a wildcard (if not used), create a list of matched paths, and then display the first matched path. If all paths do not match, the file and directory name will be cleared without changing the displayed content. To view the paths in the matching path list one by one, press Ctrl + D or Ctrl + F again. To view the list backward, press Ctrl + D or Ctrl + F while pressing Shift. To discard the saved list of matched paths and generate a new list, EditStringAnd press Ctrl + D or Ctrl + F. If you switch between Ctrl + D and Ctrl + F, the saved matching path list is discarded and a new list is generated. The only difference between Ctrl + D and Ctrl + F is that Ctrl + D only matches the directory name, while Ctrl + F matches both the file name and directory name. If the command in any internal directory (that isCD,MDOrRD.

If the matching path is enclosed in quotation marks, the file and directory names are processed correctly with spaces or special characters.

Quotation marks are required for the following special characters: & <> [] {}^ = ;! '+ ,'~ [Space]

If the provided information contains spaces, enclose the text in quotation marks (for example,"Computer Name").

IfStringAfter the file and directory names are processed in [Path] Any part on the right of the cursorString).

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.