.

windows command processor


Command Processor Commands

Programming element Description
ATTRIB This command displays or changes the attributes of a file.
CALL This command calls one batch program from another.
CHDIR, CD This command displays the name of the current directory, or changes the current directory.
CLS This command clears the screen.
COPY This command copies one or more files to another directory.
DATE This command displays or sets the date.
DIR This command displays the files and subdirectories that a directory contains.
ECHO This command displays a message, or sets whether or not the command processor echoes the commands that the user enters.
ERASE, DEL This command deletes one or more files.
EXIT This command exits the command processor shell.
GOTO This command directs the command processor to a labeled line in a batch program.
HELP This command displays a list of available commands.
IF This command performs conditional processing in batch programs.
MKDIR, MD This command creates a directory.
MOVE This command moves files from one directory to another directory.
net This command performs network-related operations.
PATH This command displays or sets a search path for executable files.
PAUSE This command suspends the processing of a batch program.
PROMPT This command changes the prompt for the command processor.
PWD This command prints current directory path.
REM This command records comments in a batch file.
RENAME, REN This command renames a file or files.
RMDIR, RD This command removes a directory.
SET This command sets or removes an environment variable, or displays the values of all of the environment variables.
SHIFT This command changes the position of replaceable parameters in a batch file.
START This command starts a separate window that runs a specified application or command.
TIME This command displays or sets the system time.
TITLE This command sets the title of the command processor window.
TYPE This command displays the contents of one or more text files.

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.