In Windows, the shell is presented in the desktop via Windows Terminal or on older versions via Windows Console.
In OS/2 and Windows, the shell supports pipes to allow both sides of a pipeline to run concurrently. As a result, it is possible to redirect the standard error stream. In contrast, COMMAND.COM uses temporary files, and runs the two sides serially, one after the other.
Multiple commands can be included in a single line using the command separator & or &&.9
With the & separator, a subsequent command is executed even if the previous command indicates an error.10 In the following example, each of the three commands is executed, one after the other, and regardless of their result code.
With the && separator, a command must complete successfully for the subsequent command to execute. In the following example, CommandB only executes if CommandA completes successfully, and CommandC only executes if CommandB also completes successfully.
The shell limits the length of a command line which includes entered text, individual environment variables that are inherited by other processes, and all environment variable expansions11 On Windows XP and later, the maximum length is 8191 (213-1) characters. On earlier versions, such as Windows 2000 or Windows NT 4.0, the maximum length is 2047 (211-1) characters.
The shell reserves the following characters as special:12 &<>[]{}^=;!'+,`~ and whitespace. In some cases, an argument that contains such characters must be enclosed in double quotes to escape from the special character handling. For example:
The following sections list internal commands for implementations of the shell on various operating systems.
Internal commands in OS/2:13
Internal commands in Windows NT and later:14
Internal commands in Windows CE .NET 4.2,15 Windows CE 5.016 and Windows Embedded CE 6.0:17
The net command is available as an external command.
Internal commands in ReactOS:18
On Windows, cmd.exe provides various user experience enhancments as compared to COMMAND.COM, including:
"Notes on using the default OS/2 command processor (CMD.EXE)". www.tavi.co.uk. http://www.tavi.co.uk/os2pages/cmd.html ↩
"reactos/reactos". GitHub. December 4, 2021. https://github.com/reactos/reactos ↩
"Command Processor Shell (Windows CE .NET 4.2)". Microsoft Docs. June 30, 2006. Archived from the original on August 31, 2022. https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms879823(v%3dmsdn.10) ↩
"Command Processor Shell (Windows CE 5.0)". Microsoft Docs. September 14, 2012. Archived from the original on August 28, 2022. https://docs.microsoft.com/en-us/previous-versions/windows/embedded/aa453925(v%3dmsdn.10) ↩
"Command Processor Shell (Windows Embedded CE 6.0)". Microsoft Docs. 2012. Archived from the original on September 5, 2022. https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ee499728(v%3dwinembedded.60) ↩
Zachary, G. Pascal (1994). Showstopper! The Breakneck Race to Create Windows NT and the Next Generation at Microsoft. The Free Press. ISBN 0-02-935671-7. 0-02-935671-7 ↩
Douglas McConnaughey Boling (2001). Programming Microsoft Windows CE (2nd ed.). Microsoft Press. ISBN 978-0735614437. 978-0735614437 ↩
"cmd". Microsoft Learn. September 12, 2023. Archived from the original on November 21, 2023. https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd ↩
"Command Redirection, Pipes - Windows CMD - SS64.com". ss64.com. Retrieved September 23, 2021. https://ss64.com/nt/syntax-redirection.html ↩
Command prompt (Cmd.exe) command-line string limitation https://support.microsoft.com/en-us/help/830473/command-prompt-cmd-exe-command-line-string-limitation ↩
Microsoft Operating System/2 User's Reference (PDF). Microsoft. 1987. http://www.os2museum.com/wp/wp-content/uploads/2011/12/1987-Oct-OS2-1.0-Users_Reference.pdf ↩
Hill, Tim (1998). Windows NT Shell Scripting. Macmillan Technical Publishing. ISBN 978-1578700479. 978-1578700479 ↩
"Command Processor Commands (Windows CE .NET 4.2)". Microsoft Docs. June 30, 2006. Archived from the original on August 31, 2022. https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms879786(v=msdn.10) ↩
"Command Processor Commands (Windows CE 5.0)". Microsoft Docs. September 14, 2012. Archived from the original on August 31, 2022. https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms907227(v=msdn.10) ↩
"Command Processor Commands (Windows Embedded CE 6.0)". Microsoft Docs. January 5, 2012. Archived from the original on September 6, 2022. https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ee505427(v=winembedded.60) ↩
"Windows 2000 delayed environment variable expansion". Windows IT Pro. Archived from the original on July 13, 2015. Retrieved July 13, 2015. https://web.archive.org/web/20150713131827/http://windowsitpro.com/windows/jsi-tip-3240-windows-2000-delayed-environment-variable-expansion ↩
"Setlocal". TechNet. Microsoft. September 11, 2009. Retrieved January 13, 2015. https://technet.microsoft.com/en-us/library/bb491001.aspx ↩