cmd.exe

from Wikipedia, the free encyclopedia
cmd.exe

Logo from cmd.exe
Screenshot under Windows 8
cmd.exe version 6.2 build 9200 (version in Windows 8 ) within conhost.exe
Basic data

developer Microsoft
Current  version see Microsoft Windows
operating system OS / 2 , ReactOS , Windows NT
programming language C.
category Command line interpreter
License MS - EULA
German speaking Yes
"Cmd.exe" on microsoft.com (English)

cmd.exe (officially also called Windows command prompt ) is the operating system shell of OS / 2 , the Windows NT line and ReactOS . DOS command line commands and BAT files can be executed in the shell ( batch processing ).

functionality

If cmd.exe is called, it is called by Windows like any other Windows console program conhost.exe, which calls up the command prompt , in which instructions are not transmitted graphically through the mouse , but rather entered directly via the keyboard . In this console cmd.exe is started, which offers a command line . These can be used, for example, to copy, move or remove files. The syntax of the commands is basically the same as under MS-DOS / PC DOS with its command line interpreter COMMAND.COM , which, however, has been expanded to include numerous functions. Some internal commands have been improved, such as for and if . In addition to the internal commands, numerous other programs are available to the user as exe files or shell scripts .

If cmd.exe is started from a file link, the window is titled with the name of the link. The name of the shortcut provided in the Start menu is Command Prompt .

Innovations

Cmd.exe is a native Win32 application, so the name “DOS prompt” is misleading: a command line for MS-DOS commands is provided, but not under MS-DOS as the operating system running.

Cmd.exe has a number of advantages over COMMAND.COM, the symbol generated |in one of two processes command and a pipe between them (like on a Unix - operating system ), and no temporary file , in which first the entire output of the command to the left of the Pipe is redirected.

With Windows 2000 , the so-called command extensions were introduced, which add numerous new functions to the command line:

  • the integration of the functionality of the originally separate program DOSKEY.COM , such as a command history and macros.
  • a command line extension using Tab(deactivated by default up to Windows 2000, activated by default since Windows XP ).
  • Characters that have a special meaning (such as this |) can now be passed as parameters by prefixing the escape character  ^ .
  • The Set command supports certain expressions, such as simple arithmetic operators and the logical operators AND , OR, and XOR .
  • The Message command is now only available on and under Windows XP.
  • The For command supports numerous new parameters, so directories can be processed recursively and the content of files can be used as input parameters.
  • The If command supports many new comparison operators. The existence of a variable can also be checked.
  • The command Md supports the creation of a whole directory branch.

These innovations can be deactivated via parameters if there are compatibility problems with older batch processing files.

Resource Kit Tools

The range of functions of cmd.exe is insufficient for many practical cases, especially when compared to its competitors from the Unix environment. Microsoft responded with a free extension called Resource Kit Tools , currently in the Windows Server 2003 Resource Kit Tools version . Even if the name lists Windows Server 2003 , most of the extensions can also run in earlier operating systems. The associated documentation also explicitly lists Windows 2000 and Windows XP . One of the many functional extensions is, for example, robocopy.exe , a program for cmd.exe for copying, synchronizing and monitoring changes to files or entire directories ( already integrated in Windows Vista , Windows 7 and Windows Server 2008 without the Resource Kit).

See also

Web links

Wikibooks: Windows Batch Programming Information  - Learning and Teaching Materials

Individual documents and notes

  1. Initially mainly OS / 2 , then (also) Windows NT and much later (also open source ) ReactOS
  2. Safe with ReactOS (see also under reactos / base / shell / cmd / [English] - at GitHub ), with Windows NT and OS / 2 however only conjectured (since these are not open source )