Partager via


Command Processor Shell

For many devices, including those without a display, Microsoft® Windows® CE .NET includes a command processor shell (Cmd.exe) that is similar to Command.com in Windows 95 and Cmd.exe in Microsoft Windows NT®. The command processor shell is a command-line-driven shell that provides console input and output, and a limited number of commands.

The following line shows the syntax for calling the command processor shell.

CMD [[/C | /K] string]

Parameters

  • /C
    Carries out the command specified by string and then exits the command processor shell.
  • /K
    Carries out the command specified by string but allows the command process shell to remain active.
  • string
    Specifies a command that you want to run. The supported commands can be found in the Command Processor Commands topic.

Remarks

To obtain help with using the command processor, type help cmd at the prompt.

Windows CE allows you to write simple batch (.bat) files that use any of the supported commands.

You can redirect standard input or standard output data from or to a file respectively by using the less than (<) or greater than (>) characters. You can pipe data to another command by using the pipe (|) character.

The syntax of the command line supported by the command processor is as follows.

COMMAND [OPTIONS] [[2]>[>] file1] [< file2] [{&, |} COMMAND...]

The following table describes the different elements of the command line.

Element Description
COMMAND Specifies the name of the command that you want to execute.
OPTIONS Specifies any parameters that you want to use for the command. For more information about the parameters available for each command, see the documentation for the command that you want to use.
> Redirects text output of a command or program to a file.
2> Redirects error output of a program to a file.
>> Appends text output of a program to a file.
2>> Appends error output of a program to a file.
< Reads text input of a command or program from a file.
& Separates two or more commands executed sequentially.
| Separates two or more commands, but output of all commands except the last is sent as the input for the subsequent command.
file1 Specifies the name of a file that receives the output of the command.
file2 Specifies the name of a file provides the input for the command.

Note   The Windows CE command processor does not require you to place quotes around names that contain spaces.

The Windows CE command processor also does not support redirection in between command line arguments. Characters that redirect input or output should appear after all of the arguments in the command line.

See Also

Command Processor Registry Settings | Command Processor Commands

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.