fbpx
维基百科

COMMAND.COM

COMMAND.COM是MS-DOSWindows 95Windows 98Windows 98SEWindows Me下默认的命令行解释器。在DOS环境下,它也是默认用户界面。它一般还是系统启动后运行的第一个程序(即init),因此负责运行AUTOEXEC.BAT配置文件以设置系统环境,也是所有进程的父进程。

COMMAND.COM
Windows 8上的COMMAND.COM
其他名称MS-DOS Prompt,
Windows Command Interpreter
開發者Seattle Computer Products, IBM, Microsoft, The Software Link, Datalight, Novell, Caldera
首次发布1980年,​44年前​(1980
编程语言x86 汇编语言[1]
操作系统
平台16位 x86
由…取代cmd.exe
类型命令行解释器
command.com在Windows 95上的Windows控制台里运行(MS-DOS命令提示符)

COMMAND.COM在OS/2Windows NT上的继任者是cmd.exe。即便如此,COMMAND.COM在这些系统的IA-32版本上的DOS虚拟机中仍然可用。

文件名COMMAND.COM也被Disk Control Program​(德语) (DCP)——前东德公司VEB Robotron发行的MS-DOS变体使用。[2]

FreeDOS下与之兼容的命令处理程序有时也称作FreeCom。

COMMAND.COM是DOS程序。由COMMAND.COM启动的程序都是DOS程序,调用DOS API与磁盘操作系统通信。

操作模式 编辑

作为一个用户界面,COMMAND.COM有两种截然不同的操作模式。第一种是交互模式,用户输入的指令会被立即执行;第二种是批处理模式,负责执行存储在名称以.BAT结尾文本文件中的一组预定义命令。

内部命令 编辑

内部命令是直接存储于COMMAND.COM二进制文件中的命令。因此,它们一直可用,但只能直接执行于命令直译器。

↵ Enter键在一行末尾按下后,所有命令才被执行。COMMAND.COM不区分大小写,也就是说命令可以按照任意大小写组合输入。

BREAK
通过Ctrl+CCtrl+Break控制程序中断。
CHCP
显示或更改当前系统的代码页
CHDIR, CD
更改当前工作目录或显示当前处于的目录。
CLS
清除屏幕显示。
COPY
将一个文件复制到另一个位置(若目标文件已存在,MS-DOS会询问是否替换)。(另请参见XCOPY,一个可以复制目录树的外部命令)
CTTY
定义输入输出所用的设备。
DATE
显示和设置系统日期。
DEL, ERASE
删除一个文件。在对一个目录操作时,仅删除目录下的所有文件。与之相对,外部命令command不仅删除目录下的全部子目录及所有文件,也删除目录本身。
DIR
列出指定目录下的文件。
ECHO
切换文本显示开启(ECHO ON) 或关闭(ECHO OFF)。也用于在屏幕上显示字符(ECHO text)。
EXIT
退出COMMAND.COM并返回到启动它的程序。
LFNFOR
开启/关闭FOR命令返回长文件名的功能(Windows 9x)。
LOADHIGH, LH
将一个程序载入内存的高地址区域(相当于DR-DOSHILOAD)。
LOCK
允许外部程序执行低层磁盘访问(仅MS-DOS 7.1Windows 9x)。
MKDIR,MD
新建一个目录。
PATH
显示或更改控制COMMAND.COM查找可执行文件位置的PATH环境变量值。
PROMPT
显示或更改控制命令行外观的PROMPT环境变量值。
RENAME, REN
重命名一个文件或目录。
RMDIR, RD
删除一个空目录。
SET
设置一个环境变量的值;无参数时,显示全部已定义的环境变量。
TIME
显示和设置系统时间。
TRUENAME
Display the fully expanded physical name of a file, resolving ASSIGN, JOIN and SUBST logical filesystem mappings.[3]
TYPE
在控制台上显示文件内容。
UNLOCK
关闭低层磁盘访问(仅MS-DOS 7.1和Windows 9x)。
VER
显示操作系统版本。
VERIFY
开启/关闭文件写入验证。
VOL
显示卷宗的信息。

批处理命令 编辑

控制结构多用于批处理文件中,即使也可以在交互模式下使用。[4][3]

:label
定义GOTO的目标。
CALL
执行另一个批处理文件,然后返回到原文件并继续。
FOR
迭代:为每一个特定组的文件重复一个命令。
GOTO
将执行过程强行跳转到一个特定标签。标签在一行的开始处指定,以冒号开始(:likethis)。
IF
条件语句,建立程序分支。
PAUSE
暂停程序执行,向用户显示消息“按任意键继续”。
REM
注释:此命令后所有文本被忽略。
SHIFT
将每个可换位参数(Replacement parameters)以其后一个替代(即用%1替代%0,用%2替代%1等)

IF命令 编辑

在退出的时候,所有外部命令都会向调用者给出一个介于 0 到 255 之间的返回码。绝大多数程序对于它们的返回码有一些约定,例如使用 0 表示成功执行。[5][6][7][8]

如果程序是由 COMMAND.COM 调用的,那么使用 ERRORLEVEL 作为条件句的 IF 内部命令可以用于判断最后调用的外部程序的错误状态。

在 COMMAND.COM 中,内部命令不产生新的值。

变量 编辑

COMMAND.COM批处理文件允许四种变量类型:

  • 环境变量:形如 %VARIABLE%,使用 SET 语句赋值。在 DOS 3 之前,COMMAND.COM 仅会在批处理模式中展开环境变量,或者说在命令提示符中不能使用。[來源請求]
  • 可换位参数:形如 %0, %1...%9,默认包含命令名称和传递给脚本的前九个命令行参数(例如,如果调用命令“myscript.bat John Doe”,那么 %0 是 “myscript.bat”,%1 是“John”,%2 是“Doe”)。第九个之后的参数可以使用 SHIFT 语句移动到前九个的范围内。
  • 循环变量:在批处理文件中形如 %%a,使用于循环中。这些变量仅由一个特定的 FOR 语句定义,然后在该语句中遍历一系列给定的值。
  • 在 4DOS 3.00 及其后续版本[9]和 Multiuser DOS[3] 中,COMMAND.COM 还支持一系列系统环境变量英语System Information Variable,后来 Novell DOS 7、OpenDOS 7.01、DR-DOS 7.02 也跟进了这个功能[4][10][3],虽然它们所支持的变量名几乎完全不同。

重定向、管道及连接 编辑

由于DOS是单用户操作系统,管道由按顺序执行多个命令并重定向到临时文件(或从临时文件重定向)实现。COMMAND.COM不支持重定向到标准错误输出

command < filename
从一个文件或设备重定向标准输入
command > filename
重定向标准输出,若文件存在则覆盖目标文件
command >> filename
重定向标准输出,若文件存在则追加到目标文件结尾
command1 | command2
command1标准输出管道至command2标准输入
command1command2
由ASCII-20(¶, 用 Ctrl+T输入)分隔的命令将被连续执行(即命令的“连接”)。[3] 也就是说,command1执行完毕后才会执行command2[3] 这是MS-DOS/PC DOS 5.0及更高的COMMAND.COM中一个未在文档中写明的功能。[3] 这项功能也得到Windows NT系列与DR-DOS 7.07下的COMMAND.COM支持。DR-DOS下所有版本的COMMAND.COM支持一个类似的内部函数,但由感叹号 (!) 调用(一项最初由Concurrent DOS和Multiuser DOS衍生的功能)。 然而,在单用户命令行环境下,这个功能只在内部(如内置的"!DATE!TIME"启动脚本)或间接通过DOSKEY的$T参数可用,以避免因 !可作为有效文件名字符产生问题。[3] 4DOS支持可配置的命令行分隔符(4DOS.INI CommandSep= 或 SETDOS /C),默认为“^”。[9]在更高版本的Windows NT下,COMMAND.COM还支持&分隔符,以提供与OS/2及Windows NT系列cmd语法的兼容性(然而cmd不支持¶分隔符)。[9]

限制 编辑

交互模式下命令行长度不得超过126字符。[11][12][13]在MS-DOS 6.2.2中,交互模式的命令行长度限制为127字符。

流行文化 编辑

终结者重新启动时,在终结者的HUD视图中和机械战警的内部视图中显示有“正在加载 COMMAND.COM”(Loading COMMAND.COM)。

在计算机制作的动画连续剧ReBoot英语ReBoot中(该剧的背景发生在计算机内部),系统(相当于城市)的领导者被称为 COMMAND.COM。

參見 编辑

  • UEFI Shell英语UEFI#UEFI_shell(UEFI Shell参考了大量来自COMMAND.COM的指令)
  • IBMBIO.COM英语IBMBIO.COM/ IO.SYS英语IO.SYS (starts the command processor as the first process)
  • SHELL (CONFIG.SYS directive)英语CONFIG.SYS#SHELL (to override default command processor)
  • COMSPEC (环境变量)英语COMSPEC(由COMMAND.COM设置,reload transient portion of itself)
  • CMDLINE (环境变量)英语Environment_variable#%CMDLINE%(由COMMAND.COM设置,用于与外部程序传递较长的命令行)
  • 4DOS英语4DOS / NDOS英语4DOS#NDOS (第三方的命令处理器)
  • DOSSHELL英语DOS_Shell / ViewMAX英语ViewMAX (另一种 DOS shells)
  • MS-DOS命令列表
  • 不同命令行的比较英语Comparison_of_command_shells
  • Concurrent DOS英语Multiuser_DOS#Concurrent_DOS/Multiuser DOS英语Multiuser_DOS/REAL/32英语Multiuser_DOS#REAL/32 (有相似的命令处理器,但不叫COMMAND.COM)
  • PC-MOS/386英语PC-MOS/386 (有相似的命令处理器,也叫COMMAND.COM)
  • Transient Program Area英语CP/M#Transient_Program_Area (TPA) (area available for use either by the running application or the transient portion of COMMAND.COM)
  • SpartaDOS X英语SpartaDOS_X (一个用于Atari电脑的相似实现)

參考資料 编辑

  1. ^ MS-DOS/COMMAND.ASM at master · microsoft/MS-DOS · GitHub. [2021-04-23]. (原始内容于2021-02-27). 
  2. ^ Kurth, Rüdiger; Groß, Martin; Hunger, Henry. Betriebssystem DCP. www.robotrontechnik.de. 2016-11-29 [2007] [2019-04-28]. (原始内容于2019-04-03) (德语). 
  3. ^ 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 Paul, Matthias R. . MPDOSTIP. Release 157 3. 1997-07-30 [1994-05-01] [2014-08-06]. (原始内容存档于4 November 2016) (德语).  (NB. The provided link points to a HTML-converted version of the NWDOSTIP.TXT, which is part of the MPDOSTIP.ZIP collection.)
  4. ^ 4.0 4.1 . Caldera DR-DOS 7.02 User Guide. Caldera, Inc. 1998 [1993, 1997] [2017-09-11]. (原始内容存档于2017-09-11). 
  5. ^ Paul, Matthias R. BATTIPs — Tips & Tricks zur Programmierung von Batchjobs. MPDOSTIP. 1997-05-01. Kapitel 7: ERRORLEVEL abfragen [1993-10-01] [2017-08-23]. (原始内容于2017-08-23) (德语).  (NB. BATTIPS.TXT is part of MPDOSTIP.ZIP. The provided link points to a HTML-converted older version of the BATTIPS.TXT file.)
  6. ^ Auer, Eric; Paul, Matthias R.; Hall, Jim. . 2015-12-24 [2003-12-31]. (原始内容存档于2015-12-24). 
  7. ^ Paul, Matthias R. Auer, Eric , 编. Exitcodes (errorlevels) of DOS utilities. 2003 [1997] [2017-09-11]. (原始内容存档于11 September 2017).  [3]
  8. ^ Allen, William; Allen, Linda. . (原始内容存档于2005-10-29). 
  9. ^ 9.0 9.1 9.2 Brothers, Hardin; Rawson, Tom; Conn, Rex C.; Paul, Matthias R.; Dye, Charles E.; Georgiev, Luchezar I. 4DOS 8.00 online help. 2002-02-27. […] Multiple Commands: You can type several commands on the same command line, separated by a caret [^]. For example, if you know you want to copy all of your .TXT files to drive A: and then run CHKDSK to be sure that drive A's file structure is in good shape, you could enter the following command: C:\>COPY *.TXT A: ^ CHKDSK A: You may put as many commands on the command line as you wish, as long as the total length of the command line does not exceed 511 characters. You can use multiple commands in aliases and batch files as well as at the command line. If you don't like using the default command separator, you can pick another character using the SETDOS /C command or the CommandSep directive in 4DOS.INI. […] SETDOS /C: (Compound character) This option sets the character used for separating multiple commands on the same line. The default is the caret [^]. You cannot use any of the redirection characters [<>|], or the blank, tab, comma, or equal sign as the command separator. The command separator is saved by SETLOCAL and restored by ENDLOCAL. This example changes the separator to a tilde [~]: C:\>SETDOS /C~ (You can specify either the character itself, or its ASCII code as a decimal number, or a hexadecimal number preceded by 0x.) […] CommandSep = c (^): This is the character used to separate multiple commands on the same line. […] Special Character Compatibility: If you use two or more of our products, or if you want to share aliases and batch files with users of different products, you need to be aware of the differences in three important characters: the Command Separator […], the Escape Character […], and the Parameter Character […]. The default values of each of these characters in each product is shown in the following chart: […] Product, Separator, Escape Parameter […] 4DOS: ^, ↑, & […] 4OS2, 4NT, Take Command: &, ^, $ […] (The up-arrow [↑] represents the ASCII Ctrl-X character, numeric value 24.) […] 
  10. ^ . Caldera, Inc. 1998 [1993, 1997] [2013-08-10]. (原始内容存档于2016-11-04). 
  11. ^ Paul, Matthias R. MSDOSTIPs — Tips für den Umgang mit MS-DOS 5.0-7. MPDOSTIP. 1997-07-01 [1994-01-01] [2013-10-25]. (原始内容于2017-08-22) (德语).  (NB. MSDOSTIP.TXT is part of MPDOSTIP.ZIP, maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the MSDOSTIP.TXT file.)
  12. ^ Paul, Matthias R. Hinweise zu JPSofts 4DOS 5.5b/c, 5.51, 5.52a und NDOS. MPDOSTIP. 1997-05-01 [1995-03-01] [2015-05-08]. (原始内容于2016-11-04) (德语).  (NB. The provided link points to a HTML-converted version of the 4DOS5TIP.TXT file, which is part of the MPDOSTIP.ZIP collection.)
  13. ^ Schulman, Andrew; Brown, Ralf D.; Maxey, David; Michels, Raymond J.; Kyle, Jim. Undocumented DOS: A programmer's guide to reserved MS-DOS functions and data structures - expanded to include MS-DOS 6, Novell DOS and Windows 3.1  2. Reading, Massachusetts, USA: Addison Wesley. 1994: 623, 626 [November 1993]. ISBN 0-201-63287-X.  (xviii+856+vi pages, 3.5"-floppy) Errata:

延伸阅读 编辑

  • Cooper, Jim. Special Edition Using MS-DOS 6.22 3. Que Publishing. 2001. ISBN 978-0-78972573-8. 
  • Wolverton, Van. MS-DOS Commands: Microsoft Quick Reference 4th revised. Microsoft Press. 1990. ISBN 978-1-55615289-4. 
  • Paul, Matthias R. Re: Random Lockups with DR-DOS 7.03. FidoNet conference: ALT_DOS. 2004-06-17 [2019-04-28]. (原始内容存档于2019-04-28). […] all MS-DOS versions prior to Windows 95 […] used a COM style COMMAND.COM file which has a special signature at the start of the file […] queried by the MS-DOS BIOS before it loads the shell, but not by the DR-DOS BIOS […] COMMAND.COM would […] check that it is running on the "correct" DOS version, so if you would load their COMMAND.COM under DR-DOS, you would receive a "Bad version" error message and their COMMAND.COM would exit, so DR-DOS would […] display an error message "Bad or missing command interpreter" (if DR-DOS was trying to load the SHELL= command processor after having finished CONFIG.SYS processing). In this case, you could enter the path to a valid DR-DOS COMMAND.COM (C:\DRDOS\COMMAND.COM) and everything was fine. Now, things have changed since MS-DOS 7.0 […] COMMAND.COM has internally become an EXE style file, so there is no magic […] signature […] to check […] thus no way for DR-DOS to rule out an incompatible COMMAND.COM. Further, their COMMAND.COM no longer does any version checks, but […] does not work under DR-DOS […] just crashes […] the PC DOS COMMAND.COM works fine under DR-DOS […]  [8][9]

外部連結 编辑

  • GitHub上的COMMAND.ASM頁面 – Source code to COMMAND.COM version 2.11 released by Microsoft as part of MS-DOS 2.0
  • GitHub上的COMMAND.ASM頁面 – Source code to COMMAND.COM version 1.17 released by Microsoft as part of MS-DOS 1.25
  • FreeCom (页面存档备份,存于互联网档案馆) – COMMAND.COM implementation of FreeDOS

command, 本條目存在以下問題, 請協助改善本條目或在討論頁針對議題發表看法, 此條目需要精通或熟悉软件的编者参与及协助编辑, 2010年6月14日, 請邀請適合的人士改善本条目, 更多的細節與詳情請參见討論頁, 此條目可参照英語維基百科相應條目来扩充, 2020年8月9日, 若您熟悉来源语言和主题, 请协助参考外语维基百科扩充条目, 请勿直接提交机械翻译, 也不要翻译不可靠, 低品质内容, 依版权协议, 译文需在编辑摘要注明来源, 或于讨论页顶部标记, href, template, translated,. 本條目存在以下問題 請協助改善本條目或在討論頁針對議題發表看法 此條目需要精通或熟悉软件的编者参与及协助编辑 2010年6月14日 請邀請適合的人士改善本条目 更多的細節與詳情請參见討論頁 此條目可参照英語維基百科相應條目来扩充 2020年8月9日 若您熟悉来源语言和主题 请协助参考外语维基百科扩充条目 请勿直接提交机械翻译 也不要翻译不可靠 低品质内容 依版权协议 译文需在编辑摘要注明来源 或于讨论页顶部标记 a href Template Translated page html title Template Translated page Translated page a 标签 此條目目前正依照en COMMAND COM上的内容进行翻译 2023年3月27日 如果您擅长翻译 並清楚本條目的領域 欢迎协助翻譯 改善或校对本條目 此外 长期闲置 未翻譯或影響閱讀的内容可能会被移除 目前的翻译进度为 85 提示 此条目页的主题不是cmd exe COMMAND COM是MS DOS Windows 95 Windows 98 Windows 98SE和Windows Me下默认的命令行解释器 在DOS环境下 它也是默认用户界面 它一般还是系统启动后运行的第一个程序 即init 因此负责运行AUTOEXEC BAT配置文件以设置系统环境 也是所有进程的父进程 COMMAND COMWindows 8上的COMMAND COM其他名称MS DOS Prompt Windows Command Interpreter開發者Seattle Computer Products IBM Microsoft The Software Link Datalight Novell Caldera首次发布1980年 44年前 1980 编程语言x86 汇编语言 1 操作系统86 DOSMS DOSPC DOSDR DOSSISNE plusPTS DOSROM DOSOS 2Windows 9xWindows NT NTVDM FreeDOSMSX DOS平台16位 x86由 取代cmd exe类型命令行解释器command com在Windows 95上的Windows控制台里运行 MS DOS命令提示符 COMMAND COM在OS 2和Windows NT上的继任者是cmd exe 即便如此 COMMAND COM在这些系统的IA 32版本上的DOS虚拟机中仍然可用 文件名COMMAND COM 也被Disk Control Program 德语 DCP 前东德公司VEB Robotron发行的MS DOS变体使用 2 FreeDOS下与之兼容的命令处理程序有时也称作FreeCom COMMAND COM是DOS程序 由COMMAND COM启动的程序都是DOS程序 调用DOS API与磁盘操作系统通信 目录 1 操作模式 2 内部命令 3 批处理命令 4 IF命令 5 变量 6 重定向 管道及连接 7 限制 8 流行文化 9 參見 10 參考資料 11 延伸阅读 12 外部連結操作模式 编辑作为一个用户界面 COMMAND COM有两种截然不同的操作模式 第一种是交互模式 用户输入的指令会被立即执行 第二种是批处理模式 负责执行存储在名称以 BAT结尾文本文件中的一组预定义命令 内部命令 编辑内部命令是直接存储于COMMAND COM二进制文件中的命令 因此 它们一直可用 但只能直接执行于命令直译器 当 Enter键在一行末尾按下后 所有命令才被执行 COMMAND COM不区分大小写 也就是说命令可以按照任意大小写组合输入 BREAK 通过Ctrl C或Ctrl Break控制程序中断 CHCP 显示或更改当前系统的代码页 CHDIR CD 更改当前工作目录或显示当前处于的目录 CLS 清除屏幕显示 COPY 将一个文件复制到另一个位置 若目标文件已存在 MS DOS会询问是否替换 另请参见XCOPY 一个可以复制目录树的外部命令 CTTY 定义输入输出所用的设备 DATE 显示和设置系统日期 DEL ERASE 删除一个文件 在对一个目录操作时 仅删除目录下的所有文件 与之相对 外部命令command不仅删除目录下的全部子目录及所有文件 也删除目录本身 DIR 列出指定目录下的文件 ECHO 切换文本显示开启 ECHO ON 或关闭 ECHO OFF 也用于在屏幕上显示字符 ECHO text EXIT 退出COMMAND COM并返回到启动它的程序 LFNFOR 开启 关闭FOR命令返回长文件名的功能 Windows 9x LOADHIGH LH 将一个程序载入内存的高地址区域 相当于DR DOS的HILOAD LOCK 允许外部程序执行低层磁盘访问 仅MS DOS 7 1和Windows 9x MKDIR MD 新建一个目录 PATH 显示或更改控制COMMAND COM查找可执行文件位置的PATH环境变量值 PROMPT 显示或更改控制命令行外观的PROMPT环境变量值 RENAME REN 重命名一个文件或目录 RMDIR RD 删除一个空目录 SET 设置一个环境变量的值 无参数时 显示全部已定义的环境变量 TIME 显示和设置系统时间 TRUENAME Display the fully expanded physical name of a file resolving ASSIGN JOIN and SUBST logical filesystem mappings 3 TYPE 在控制台上显示文件内容 UNLOCK 关闭低层磁盘访问 仅MS DOS 7 1和Windows 9x VER 显示操作系统版本 VERIFY 开启 关闭文件写入验证 VOL 显示卷宗的信息 批处理命令 编辑控制结构多用于批处理文件中 即使也可以在交互模式下使用 4 3 label 定义GOTO的目标 CALL 执行另一个批处理文件 然后返回到原文件并继续 FOR 迭代 为每一个特定组的文件重复一个命令 GOTO 将执行过程强行跳转到一个特定标签 标签在一行的开始处指定 以冒号开始 likethis IF 条件语句 建立程序分支 PAUSE 暂停程序执行 向用户显示消息 按任意键继续 REM 注释 此命令后所有文本被忽略 SHIFT 将每个可换位参数 Replacement parameters 以其后一个替代 即用 1替代 0 用 2替代 1等 IF命令 编辑在退出的时候 所有外部命令都会向调用者给出一个介于 0 到 255 之间的返回码 绝大多数程序对于它们的返回码有一些约定 例如使用 0 表示成功执行 5 6 7 8 如果程序是由 COMMAND COM 调用的 那么使用 ERRORLEVEL 作为条件句的 IF 内部命令可以用于判断最后调用的外部程序的错误状态 在 COMMAND COM 中 内部命令不产生新的值 变量 编辑COMMAND COM批处理文件允许四种变量类型 环境变量 形如 VARIABLE 使用 SET 语句赋值 在 DOS 3 之前 COMMAND COM 仅会在批处理模式中展开环境变量 或者说在命令提示符中不能使用 來源請求 可换位参数 形如 0 1 9 默认包含命令名称和传递给脚本的前九个命令行参数 例如 如果调用命令 myscript bat John Doe 那么 0 是 myscript bat 1 是 John 2 是 Doe 第九个之后的参数可以使用 SHIFT 语句移动到前九个的范围内 循环变量 在批处理文件中形如 a 使用于循环中 这些变量仅由一个特定的 FOR 语句定义 然后在该语句中遍历一系列给定的值 在 4DOS 3 00 及其后续版本 9 和 Multiuser DOS 3 中 COMMAND COM 还支持一系列系统环境变量 英语 System Information Variable 后来 Novell DOS 7 OpenDOS 7 01 DR DOS 7 02 也跟进了这个功能 4 10 3 虽然它们所支持的变量名几乎完全不同 重定向 管道及连接 编辑由于DOS是单用户操作系统 管道由按顺序执行多个命令并重定向到临时文件 或从临时文件重定向 实现 COMMAND COM不支持重定向到标准错误输出 i command i lt i filename i 从一个文件或设备重定向标准输入 i command i gt i filename i 重定向标准输出 若文件存在则覆盖目标文件 i command i gt gt i filename i 重定向标准输出 若文件存在则追加到目标文件结尾 i command1 i i command2 i 将command1的标准输出管道至command2的标准输入 i command1 i i command2 i 由ASCII 20 用 Ctrl T输入 分隔的命令将被连续执行 即命令的 连接 3 也就是说 command1执行完毕后才会执行command2 3 这是MS DOS PC DOS 5 0及更高的COMMAND COM中一个未在文档中写明的功能 3 这项功能也得到Windows NT系列与DR DOS 7 07下的COMMAND COM支持 DR DOS下所有版本的COMMAND COM支持一个类似的内部函数 但由感叹号 调用 一项最初由Concurrent DOS和Multiuser DOS衍生的功能 然而 在单用户命令行环境下 这个功能只在内部 如内置的 DATE TIME 启动脚本 或间接通过DOSKEY的 T参数可用 以避免因 可作为有效文件名字符产生问题 3 4DOS支持可配置的命令行分隔符 4DOS INI CommandSep 或 SETDOS C 默认为 9 在更高版本的Windows NT下 COMMAND COM还支持 amp 分隔符 以提供与OS 2及Windows NT系列cmd语法的兼容性 然而cmd不支持 分隔符 9 限制 编辑交互模式下命令行长度不得超过126字符 11 12 13 在MS DOS 6 2 2中 交互模式的命令行长度限制为127字符 流行文化 编辑当终结者重新启动时 在终结者的HUD视图中和机械战警的内部视图中显示有 正在加载 COMMAND COM Loading COMMAND COM 在计算机制作的动画连续剧ReBoot 英语 ReBoot 中 该剧的背景发生在计算机内部 系统 相当于城市 的领导者被称为 COMMAND COM 參見 编辑UEFI Shell 英语 UEFI UEFI shell UEFI Shell参考了大量来自COMMAND COM的指令 IBMBIO COM 英语 IBMBIO COM IO SYS 英语 IO SYS starts the command processor as the first process SHELL CONFIG SYS directive 英语 CONFIG SYS SHELL to override default command processor COMSPEC 环境变量 英语 COMSPEC 由COMMAND COM设置 reload transient portion of itself CMDLINE 环境变量 英语 Environment variable CMDLINE 由COMMAND COM设置 用于与外部程序传递较长的命令行 4DOS 英语 4DOS NDOS 英语 4DOS NDOS 第三方的命令处理器 DOSSHELL 英语 DOS Shell ViewMAX 英语 ViewMAX 另一种 DOS shells MS DOS命令列表 不同命令行的比较 英语 Comparison of command shells Concurrent DOS 英语 Multiuser DOS Concurrent DOS Multiuser DOS 英语 Multiuser DOS REAL 32 英语 Multiuser DOS REAL 32 有相似的命令处理器 但不叫COMMAND COM PC MOS 386 英语 PC MOS 386 有相似的命令处理器 也叫COMMAND COM Transient Program Area 英语 CP M Transient Program Area TPA area available for use either by the running application or the transient portion of COMMAND COM SpartaDOS X 英语 SpartaDOS X 一个用于Atari电脑的相似实现 參考資料 编辑 MS DOS COMMAND ASM at master microsoft MS DOS GitHub 2021 04 23 原始内容存档于2021 02 27 Kurth Rudiger Gross Martin Hunger Henry Betriebssystem DCP www robotrontechnik de 2016 11 29 2007 2019 04 28 原始内容存档于2019 04 03 德语 3 0 3 1 3 2 3 3 3 4 3 5 3 6 3 7 Paul Matthias R NWDOS TIPs Tips amp Tricks rund um Novell DOS 7 mit Blick auf undokumentierte Details Bugs und Workarounds MPDOSTIP Release 157 3 1997 07 30 1994 05 01 2014 08 06 原始内容存档于4 November 2016 德语 NB The provided link points to a HTML converted version of the NWDOSTIP TXT which is part of the MPDOSTIP ZIP collection 1 4 0 4 1 Chapter 7 Batch Processing Caldera DR DOS 7 02 User Guide Caldera Inc 1998 1993 1997 2017 09 11 原始内容存档于2017 09 11 Paul Matthias R BATTIPs Tips amp Tricks zur Programmierung von Batchjobs MPDOSTIP 1997 05 01 Kapitel 7 ERRORLEVEL abfragen 1993 10 01 2017 08 23 原始内容存档于2017 08 23 德语 NB BATTIPS TXT is part of MPDOSTIP ZIP The provided link points to a HTML converted older version of the BATTIPS TXT file 2 Auer Eric Paul Matthias R Hall Jim MS DOS errorlevels 2015 12 24 2003 12 31 原始内容存档于2015 12 24 Paul Matthias R Auer Eric 编 Exitcodes errorlevels of DOS utilities 2003 1997 2017 09 11 原始内容存档于11 September 2017 3 Allen William Allen Linda Windows 95 98 ME ERRORLEVELs 原始内容存档于2005 10 29 9 0 9 1 9 2 Brothers Hardin Rawson Tom Conn Rex C Paul Matthias R Dye Charles E Georgiev Luchezar I 4DOS 8 00 online help 2002 02 27 Multiple Commands You can type several commands on the same command line separated by a caret For example if you know you want to copy all of your TXT files to drive A and then run CHKDSK to be sure that drive A s file structure is in good shape you could enter the following command C gt COPY TXT A CHKDSK A You may put as many commands on the command line as you wish as long as the total length of the command line does not exceed 511 characters You can use multiple commands in aliases and batch files as well as at the command line If you don t like using the default command separator you can pick another character using the SETDOS C command or the CommandSep directive in 4DOS INI SETDOS C Compound character This option sets the character used for separating multiple commands on the same line The default is the caret You cannot use any of the redirection characters lt gt or the blank tab comma or equal sign as the command separator The command separator is saved by SETLOCAL and restored by ENDLOCAL This example changes the separator to a tilde C gt SETDOS C You can specify either the character itself or its ASCII code as a decimal number or a hexadecimal number preceded by 0x CommandSep c This is the character used to separate multiple commands on the same line Special Character Compatibility If you use two or more of our products or if you want to share aliases and batch files with users of different products you need to be aware of the differences in three important characters the Command Separator the Escape Character and the Parameter Character The default values of each of these characters in each product is shown in the following chart Product Separator Escape Parameter 4DOS amp 4OS2 4NT Take Command amp The up arrow represents the ASCII Ctrl X character numeric value 24 Caldera DR DOS 7 02 User Guide Caldera Inc 1998 1993 1997 2013 08 10 原始内容存档于2016 11 04 Paul Matthias R MSDOSTIPs Tips fur den Umgang mit MS DOS 5 0 7 MPDOSTIP 1997 07 01 1994 01 01 2013 10 25 原始内容存档于2017 08 22 德语 NB MSDOSTIP TXT is part of MPDOSTIP ZIP maintained up to 2001 and distributed on many sites at the time The provided link points to a HTML converted older version of the MSDOSTIP TXT file 4 Paul Matthias R Hinweise zu JPSofts 4DOS 5 5b c 5 51 5 52a und NDOS MPDOSTIP 1997 05 01 1995 03 01 2015 05 08 原始内容存档于2016 11 04 德语 NB The provided link points to a HTML converted version of the 4DOS5TIP TXT file which is part of the MPDOSTIP ZIP collection 5 Schulman Andrew Brown Ralf D Maxey David Michels Raymond J Kyle Jim Undocumented DOS A programmer s guide to reserved MS DOS functions and data structures expanded to include MS DOS 6 Novell DOS and Windows 3 1 nbsp 2 Reading Massachusetts USA Addison Wesley 1994 623 626 November 1993 ISBN 0 201 63287 X 含有內容需登入查看的頁面 link xviii 856 vi pages 3 5 floppy Errata 6 7 延伸阅读 编辑Cooper Jim Special Edition Using MS DOS 6 22 3 Que Publishing 2001 ISBN 978 0 78972573 8 Wolverton Van MS DOS Commands Microsoft Quick Reference 4th revised Microsoft Press 1990 ISBN 978 1 55615289 4 Paul Matthias R Re Random Lockups with DR DOS 7 03 FidoNet conference ALT DOS 2004 06 17 2019 04 28 原始内容存档于2019 04 28 all MS DOS versions prior to Windows 95 used a COM style COMMAND COM file which has a special signature at the start of the file queried by the MS DOS BIOS before it loads the shell but not by the DR DOS BIOS COMMAND COM would check that it is running on the correct DOS version so if you would load their COMMAND COM under DR DOS you would receive a Bad version error message and their COMMAND COM would exit so DR DOS would display an error message Bad or missing command interpreter if DR DOS was trying to load the SHELL command processor after having finished CONFIG SYS processing In this case you could enter the path to a valid DR DOS COMMAND COM C DRDOS COMMAND COM and everything was fine Now things have changed since MS DOS 7 0 COMMAND COM has internally become an EXE style file so there is no magic signature to check thus no way for DR DOS to rule out an incompatible COMMAND COM Further their COMMAND COM no longer does any version checks but does not work under DR DOS just crashes the PC DOS COMMAND COM works fine under DR DOS 8 9 外部連結 编辑GitHub上的COMMAND ASM頁面 Source code to COMMAND COM version 2 11 released by Microsoft as part of MS DOS 2 0 GitHub上的COMMAND ASM頁面 Source code to COMMAND COM version 1 17 released by Microsoft as part of MS DOS 1 25 FreeCom 页面存档备份 存于互联网档案馆 COMMAND COM implementation of FreeDOS 取自 https zh wikipedia org w index php title COMMAND COM amp oldid 80788188, 维基百科,wiki,书籍,书籍,图书馆,

文章

,阅读,下载,免费,免费下载,mp3,视频,mp4,3gp, jpg,jpeg,gif,png,图片,音乐,歌曲,电影,书籍,游戏,游戏。