Windows 10 command com

«COMMAND» redirects here. For other uses, see Command.

Not to be confused with cmd.exe.

COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot (init process). As a shell, COMMAND.COM has two distinct modes of operation: interactive mode and batch mode. Internal commands are commands stored directly inside the COMMAND.COM binary; thus, they are always available, but can only be executed directly from the command interpreter.[citation needed]

COMMAND.COM

COMMAND.COM in Windows 10

Other names MS-DOS Prompt,
Windows Command Interpreter
Developer(s) Seattle Computer Products, IBM, Microsoft, The Software Link, Datalight, Novell, Caldera
Initial release 1980; 45 years ago
Written in x86 assembly language[1]
Operating system
  • 86-DOS
  • MS-DOS
  • PC DOS
  • DR-DOS
  • SISNE plus
  • PTS-DOS
  • ROM-DOS
  • OS/2
  • Windows 9x
  • Windows NT (NTVDM)
  • FreeDOS
  • MSX-DOS
Platform 16-bit x86
Successor cmd.exe
Type Command-line interpreter
command.com running in a Windows console on Windows 95 (MS-DOS Prompt)

COMMAND.COM’s successor on OS/2 and Windows NT systems is cmd.exe, although COMMAND.COM is available in virtual DOS machines on IA-32 versions of those operating systems as well. The COMMAND.COM filename was also used by Disk Control Program [de] (DCP), an MS-DOS derivative by the former East German VEB Robotron.[2]

COMMAND.COM is a DOS program. Programs launched from COMMAND.COM are DOS programs that use the DOS API to communicate with the disk operating system. The compatible command processor under FreeDOS is sometimes also called FreeCom.

As a shell, COMMAND.COM has two distinct modes of operation. The first is interactive mode, in which the user types commands which are then executed immediately. The second is batch mode, which executes a predefined sequence of commands stored as a text file with the .BAT extension.

Internal commands are commands stored directly inside the COMMAND.COM binary. Thus, they are always available but can only be executed directly from the command interpreter.

All commands are executed after the ↵ Enter key is pressed at the end of the line. COMMAND.COM is not case-sensitive, meaning commands can be typed in any mixture of upper and lower case.

BREAK
Controls the handling of program interruption with Ctrl+C or Ctrl+Break.
CHCP
Displays or changes the current system code page.
CHDIR, CD
Changes the current working directory or displays the current directory.
CLS
Clears the screen.
COPY
Copies one file to another (if the destination file already exists, MS-DOS asks whether to replace it). (See also XCOPY, an external command that could also copy directory trees).
CTTY
Defines the device to use for input and output.
DATE
Display and set the date of the system.
DEL, ERASE
Deletes a file. When used on a directory, deletes all files inside the directory only. In comparison, the external command DELTREE deletes all subdirectories and files inside a directory as well as the directory itself.
DIR
Lists the files in the specified directory.
ECHO
Toggles whether text is displayed (ECHO ON) or not (ECHO OFF). Also displays text on the screen (ECHO text).
EXIT
Exits from COMMAND.COM and returns to the program which launched it.
LFNFOR
Enables or disables the return of long filenames by the FOR command. (Windows 9x).[citation needed]
LOADHIGH, LH
Loads a program into upper memory (HILOAD in DR DOS).
LOCK
Enables external programs to perform low-level disk access to a volume. (MS-DOS 7.1 and Windows 9x only)[citation needed]
MKDIR, MD
Creates a new directory.
PATH
Displays or changes the value of the PATH environment variable which controls the places where COMMAND.COM will search for executable files.
PROMPT
Displays or change the value of the PROMPT environment variable which controls the appearance of the prompt.
RENAME, REN
Renames a file or directory.
RMDIR, RD
Removes an empty directory.
SET
Sets the value of an environment variable; without arguments, shows all defined environment variables.
TIME
Display and set the time of the system.
TRUENAME
Display the fully expanded physical name of a file, resolving ASSIGN, JOIN and SUBST logical filesystem mappings.[3]
TYPE
Display the content of a file on the console.
UNLOCK
Disables low-level disk access. (MS-DOS 7.1 and Windows 9x only)[citation needed]
VER
Displays the version of the operating system.
VERIFY
Enable or disable verification of writing for files.
VOL
Shows information about a volume.

Control structures are mostly used inside batch files, although they can also be used interactively.[4][3]

:label
Defines a target for GOTO.
CALL
Executes another batch file and returns to the old one and continues.
FOR
Iteration: repeats a command for each out of a specified set of files.
GOTO
Moves execution to a specified label. Labels are specified at the beginning of a line, with a colon (:likethis).
IF
Conditional statement, allows branching of the program execution.
PAUSE
Halts execution of the program and displays a message asking the user to press any key to continue.
REM
comment: any text following this command is ignored.
SHIFT
Replaces each of the replacement parameters with the subsequent one (e.g. %0 with %1, %1 with %2, etc.).

On exit, all external commands submit a return code (a value between 0 and 255) to the calling program. Most programs have a certain convention for their return codes (for instance, 0 for a successful execution).[5][6][7][8]

If a program was invoked by COMMAND.COM, the internal IF command with its ERRORLEVEL conditional can be used to test on error conditions of the last invoked external program.[citation needed]

Under COMMAND.COM, internal commands do not establish a new value.[citation needed]

Batch files for COMMAND.COM can have four kinds of variables:

  • Environment variables: These have the %VARIABLE% form and are associated with values with the SET statement. Before DOS 3 COMMAND.COM will only expand environment variables in batch mode; that is, not interactively at the command prompt.[citation needed]
  • Replacement parameters: These have the form %0, %1%9, and initially contain the command name and the first nine command-line parameters passed to the script (e.g., if the invoking command was myscript.bat John Doe, then %0 is «myscript.bat», %1 is «John» and %2 is «Doe»). The parameters to the right of the ninth can be mapped into range by using the SHIFT statement.[citation needed]
  • Loop variables: Used in loops, they have the %%a format when run in batch files. These variables are defined solely within a specific FOR statement, and iterate over a certain set of values defined in that FOR statement.[citation needed]
  • Under Novell DOS 7, OpenDOS 7.01, DR-DOS 7.02 and higher, COMMAND.COM also supports a number of system information variables,[4][9][3] a feature earlier found in 4DOS 3.00 and higher[10] as well as in Multiuser DOS,[3] although most of the supported variable names differ.

Redirection, piping, and chaining


edit

Because DOS is a single-tasking operating system, piping is achieved by running commands sequentially, redirecting to and from a temporary file.[citation needed] COMMAND.COM makes no provision for redirecting the standard error channel.[citation needed]

command < filename
Redirect standard input from a file or device
command > filename
Redirect standard output, overwriting target file if it exists.
command >> filename
Redirect standard output, appending to target file if it exists.
command1 | command2
Pipe standard output from command1 to standard input of command2
command1command2
Commands separated by ASCII-20 (¶, invoked by Ctrl+T) are executed in sequence (chaining of commands).[3] In other words, first command1 is executed until termination, then command2.[3] This is an undocumented feature in COMMAND.COM of MS-DOS/PC DOS 5.0 and higher.[3] It is also supported by COMMAND.COM of the Windows NT family as well as by DR-DOS 7.07. All versions of DR-DOS COMMAND.COM already supported a similar internal function utilizing an exclamation mark (!) instead (a feature originally derived from Concurrent DOS and Multiuser DOS) — in the single-user line this feature was only available internally (in built-in startup scripts like «!DATE!TIME») and indirectly through DOSKEY’s $T parameter to avoid problems with ! as a valid filename character.[3] 4DOS supports a configurable command line separator (4DOS.INI CommandSep= or SETDOS /C), which defaults to ^.[10] COMMAND.COM in newer versions of Windows NT also supports an & separator for compatibility with the cmd syntax in OS/2 and the Windows NT family.[10] (cmd does not support the ¶ separator.)

Generally, the command line length in interactive mode is limited to 126 characters.[11][12][13] In MS-DOS 6.22, the command line length in interactive mode is limited to 127 characters.[citation needed]

  • The message «Loading COMMAND.COM» can be seen on a HUD view of the Terminator and the internal viewport of RoboCop when he reboots.[citation needed]
  • In the animated children’s TV series ReBoot, which takes place inside computers, the leader of a system (the equivalent of a city) is called the COMMAND.COM.[citation needed]
  • List of DOS commands
  • Comparison of command shells
  • cmd.exe — command-line interpreter in various Windows and OS/2 systems
    • IBMBIO.COM
    • IO.SYS

    — starts the command processor as the first process

  • SHELL (CONFIG.SYS directive) — to override default command processor
  • COMSPEC (environment variable) — set by COMMAND.COM to reload transient portion of itself
  • CMDLINE (environment variable) — set by COMMAND.COM to pass long command lines to external programs
    • 4DOS
    • NDOS

    — third-party replacement command processors

  • DOSSHELL / ViewMAX — alternative DOS shells
    • Concurrent DOS
    • Multiuser DOS
    • REAL/32

    — have similar command processors not named COMMAND.COM

  • PC-MOS/386 — has a similar command processor also named COMMAND.COM
  • Transient Program Area — memory available for use either by the running application or the transient portion of COMMAND.COM
  • SpartaDOS X — a similar implementation for Atari computers
  1. ^ «MS-DOS/COMMAND.ASM at master · microsoft/MS-DOS». GitHub.
  2. ^ Kurth, Rüdiger; Groß, Martin; Hunger, Henry (2016-11-29) [2007]. «Betriebssystem DCP». www.robotrontechnik.de (in German). Archived from the original on 2019-04-03. Retrieved 2019-04-28.
  3. ^ a b c d e f g h Paul, Matthias R. (1997-07-30) [1994-05-01]. NWDOS-TIPs — Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds. Release 157 (in German) (3 ed.). MPDOSTIP. Archived from the original on 2016-11-04. Retrieved 2014-08-06. (NB. The provided link points to a HTML-converted version of the NWDOSTIP.TXT, which is part of the MPDOSTIP.ZIP collection.) [1]
  4. ^ a b «Chapter 7: Batch Processing». Caldera DR-DOS 7.02 User Guide. Caldera, Inc. 1998 [1993, 1997]. Archived from the original on 2017-09-11. Retrieved 2017-09-11.
  5. ^ Paul, Matthias R. (1997-05-01) [1993-10-01]. BATTIPs — Tips & Tricks zur Programmierung von Batchjobs (in German). MPDOSTIP. Kapitel 7: ERRORLEVEL abfragen. Archived from the original on 2017-08-23. Retrieved 2017-08-23. (NB. BATTIPS.TXT is part of MPDOSTIP.ZIP. The provided link points to an HTML-converted older version of the BATTIPS.TXT file.) [2]
  6. ^ Auer, Eric; Paul, Matthias R.; Hall, Jim (2015-12-24) [2003-12-31]. «MS-DOS errorlevels». Archived from the original on 2015-12-24.
  7. ^ Paul, Matthias R. (2003) [1997]. Auer, Eric (ed.). «Exitcodes (errorlevels) of DOS utilities». Archived from the original on 2017-09-11. Retrieved 2017-09-11. [3]
  8. ^ Allen, William; Allen, Linda. «Windows 95/98/ME ERRORLEVELs». Archived from the original on 2005-10-29.
  9. ^ Caldera DR-DOS 7.02 User Guide. Caldera, Inc. 1998 [1993, 1997]. Archived from the original on 2016-11-04. Retrieved 2013-08-10.
  10. ^ a b c

    […] 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.) […]

  11. ^ Paul, Matthias R. (1997-07-01) [1994-01-01]. MSDOSTIPs — Tips für den Umgang mit MS-DOS 5.0-7 (in German). MPDOSTIP. Archived from the original on 2017-08-22. Retrieved 2013-10-25. (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]
  12. ^ Paul, Matthias R. (1997-05-01) [1995-03-01]. «Hinweise zu JPSofts 4DOS 5.5b/c, 5.51, 5.52a und NDOS». MPDOSTIP (in German). Archived from the original on 2016-11-04. Retrieved 2015-05-08. (NB. The provided link points to a HTML-converted version of the 4DOS5TIP.TXT file, which is part of the MPDOSTIP.ZIP collection.) [5]
  13. ^ Schulman, Andrew; Brown, Ralf D.; Maxey, David; Michels, Raymond J.; Kyle, Jim (1994) [November 1993]. 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 ed.). Reading, Massachusetts, US: Addison Wesley. pp. 623, 626. ISBN 0-201-63287-X. (xviii+856+vi pages, 3.5″-floppy) Errata: [6] [7]

[…] 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 […]

  • Cooper, Jim (2001). Special Edition Using MS-DOS 6.22 (3 ed.). Que Publishing. ISBN 978-0-78972573-8.
  • Wolverton, Van (1990). MS-DOS Commands: Microsoft Quick Reference (4th revised ed.). Microsoft Press. ISBN 978-1-55615289-4.
  • Archived 2019-05-01 at archive.today
  • Archived 2019-04-28 at archive.today
  • COMMAND1.ASM on GitHub — Source code to COMMAND.COM version A067 released by Microsoft as part of MS-DOS 4.0
  • COMMAND.ASM on GitHub – Source code to COMMAND.COM version 2.11 released by Microsoft as part of MS-DOS 2.0
  • COMMAND.ASM on GitHub – 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.COM

Шаблон:Wikidata/p154
Шаблон:Wikidata/p18
Тип

Ошибка Lua: callParserFunction: function «#property» was not found.

Автор

Ошибка Lua: callParserFunction: function «#property» was not found.

Разработчик

Seattle Computer Products, Microsoft, IBM, Novell и др.

Написана на

Ошибка Lua в Модуль:Wikidata на строке 170: attempt to index field ‘wikibase’ (a nil value).

Интерфейс

Ошибка Lua в Модуль:Wikidata на строке 170: attempt to index field ‘wikibase’ (a nil value).

Операционная система

Ошибка Lua: callParserFunction: function «#property» was not found.

Языки интерфейса

Ошибка Lua: callParserFunction: function «#property» was not found.

Первый выпуск

Шаблон:Wikidata/p577

Аппаратная платформа

Ошибка Lua в Модуль:Wikidata на строке 170: attempt to index field ‘wikibase’ (a nil value).

Последняя версия

Шаблон:Wikidata/p348

Кандидат в релизы

Шаблон:Wikidata/p348

Бета-версия

Шаблон:Wikidata/p348

Альфа-версия

Шаблон:Wikidata/p348

Тестовая версия

Шаблон:Wikidata/p348

Читаемые форматы файлов

Ошибка Lua в Модуль:Wikidata на строке 170: attempt to index field ‘wikibase’ (a nil value).

Создаваемые форматы файлов

Ошибка Lua в Модуль:Wikidata на строке 170: attempt to index field ‘wikibase’ (a nil value).

Лицензия

Ошибка Lua в Модуль:Wikidata на строке 170: attempt to index field ‘wikibase’ (a nil value).

Сайт

Шаблон:Wikidata/p856

Шаблон:Wikidata/p373

Шаблон:Нет изображенияШаблон:Категория по дате

COMMAND.COM — интерпретатор командной строки в операционных системах DOS, OS/2, семейства Windows 9x и ряда других. Загружается при старте системы или VDM (если не указан другой интерпретатор с помощью директивы SHELL= в файле CONFIG.SYS) и выполняет команды из файла AUTOEXEC.BAT.[1]

В операционных системах семейства Windows NT (начиная с Windows NT 3.1 и заканчивая Windows 8 / Windows Server 2012) и OS/2 интерпретатором командной строки является программа cmd.exe. Однако, для совместимости с DOS-приложениями, COMMAND.COM присутствует и в версиях этих систем для процессоров архитектуры IA-32.

Режимы работы[]

COMMAND.COM имеет два режима работы. Первый режим — интерактивный, когда пользователь вводит с клавиатуры команды, которые немедленно выполняются. Второй режим — пакетный, когда COMMAND.COM выполняет последовательность команд, заранее сохранённую в пакетном файле с расширением .BAT. Функции COMMAND.COM аналогичны функциям командных интерпретаторов Unix-совместимых операционных систем (например, bash), с тем отличием, что COMMAND.COM имеет более ограниченный набор возможностей.[2][3]

Команды[]

Команды COMMAND.COM делятся на внутренние, и внешние. Внутренние команды поддерживаются самим COMMAND.COM, внешние команды являются файлами, которые хранятся на дисках и имеют расширение .COM, .EXE или .BAT.[4][5]

Часть внутренних команд используются в пакетных файлах для их оформления, организации их работы и для управления последовательностью выполнения прочих команд. Среди них:

:имя_метки
Задание имени метки для команды GOTO. Часто используется и в качестве комментария.
FOR
Повтор некоторой команды для каждого файла из заданного списка.
GOTO
Переход к метке внутри пакетного файла.
REM
Комментарий: любой текст в строке после этой команды игнорируется.
IF
Задание условия, в зависимости от которого происходит выполнение разных команд.
CALL
Приостановка выполнения текущего командного файла, запуск другого, по окончании работы вызванного файла возобновление выполнения текущего файла.[6]
START
Запуск исполняемого или командного файла, указанного в параметре этой команды, без ожидания завершения его выполнения (только под Windows).

Переменные[]

Пакетные файлы для COMMAND.COM имеют четыре типа переменных:

  1. ERRORLEVEL содержит код возврата последней из запущенных программ (к примеру, в языке программирования Си код можно вернуть с помощью return в функции main).[7][8] Как правило, ERRORLEVEL используется для индикации ошибок при работе программы и код 0 означает успешное завершение. Но это относится в основном к утилитам командной строки (которые ориентированы на использование в пакетных файлах), прикладные программы обычно не заботятся о возврате конкретных значений, поэтому после них в ERRORLEVEL всегда оказывается нулевое значение или даже мусор.[9][10] В оригинальном COMMAND.COM код возврата можно было проверить только с помощью конструкции IF ERRORLEVEL[11], однако в некоторых клонах DOS, а также Windows семейства NT, добавлена возможность обращения к ERRORLEVEL как к обычной переменной.[12][13]
  2. Переменные могут быть заданы с помощью команды SET.[14] Чтобы получить их значение, нужно имя переменной окружить знаками % (например, %path%), в этом случае в месте использования такой конструкции будет подставлено значение переменной.[15] Некоторые из этих переменных стандартизованы (PROMPT, PATH, TEMP и т. п.), некоторые задаются системой (CONFIG), остальные задаются и используются пользователями. Хранятся эти переменные в «окружении» (environment) и называются «переменными окружения».[16]
  3. Аргументы пакетных файлов в самих пакетных файлах доступны как %1…%9.[17] Переменная %0 содержит текст команды (без аргументов), использованной для запуска пакетного файла.[18]
  4. Переменные для команды FOR имеют вид %%a и используются в пакетных файлах совместно с этой командой.[18]

Параметры командной строки[]

COMMAND.COM может быть запущена не только в ходе начальной загрузки, но и, подобно любому исполняемому файлу MS-DOS, другой программой с помощью стандартной функции MS-DOS EXEC (функция 4bH прерывания 21H). При запуске без параметров запускается экземпляр интерпретатора, и управление передаётся пользователю, который может закрыть этот экземпляр и вернуть управление породившей его программе, введя команду EXIT. Но намного чаще используется запуск COMMAND.COM из других программ с параметрами /C и (реже) /K.

Параметр /C[]

Параметр /C предназначен для запуска в пакетном режиме. Синтаксис запуска:
COMMAND.COM /C команда
Командой может быть любая внутренняя или внешняя команда COMMAND.COM, в том числе BAT-файл. После исполнения команды работа COMMAND.COM завершается, и управление возвращается породившей его программе.

Параметр /K[]

Параметр /K полностью аналогичен параметру /C с той разницей, что после исполнения команды экземпляр интерпретатора не завершается, и управление передаётся пользователю, который может закрыть этот экземпляр и вернуть управление породившей его программе, введя команду EXIT.

См. также[]

  • Сравнение командных оболочек

Примечания[]

  1. Q95554: Not Using the /P Switch with the SHELL Command (en). Microsoft (18 января 2007). — См.: Background Information on SHELL and /P. Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  2. 5.2 Command Execution (en). GNU Make Manual. Шаблон:Translation (июнь 2003). — «The stock shell, `command.com’, is ridiculously limited in its functionality and many users of make tend to install a replacement shell»  Проверено 16 января 2010.
  3. «batch files are much more limited than their UNIX counterparts» // Шаблон:±. User Interface // Operating systems incorporating UNIX and Windows. — 4-е изд. — Cengage Learning EMEA, 2003. — P. 41. — 279 p. — ISBN 0-82-646416-5, ISBN 978-0-8264-6416-3.
  4. Q71986: MS-DOS 5.0 Internal and External Commands (en). Microsoft (3 декабря 1999). Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  5. Batch Commands (en). TechNet Library → MS-DOS. Microsoft. Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  6. Если вызвать из пакетного файла другой пакетный файл напрямую, без помощи команды CALL, то возврата из вызванного пакетного файла не будет, он заменит первый пакетный файл.
  7. Q57658: Setting the MS-DOS Errorlevel in a Program (en). Microsoft (12 мая 2003). Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  8. Main() Return Values (C# Programming Guide) (en). Microsoft (июль 2009). Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  9. Q81819: Exit Codes or Errorlevels Set by MS-DOS Commands (en). Microsoft (16 ноября 2006). Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  10. Q41533: Basic 7.00 Can Return Exit Code (Error Level) to Batch File (en). Microsoft (21 ноября 2006). Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  11. Q69576: Testing for a Specific Error Level in Batch Files (en). Microsoft (16 ноября 2006). Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  12. Using System Information (en). Caldera DR-DOS 7.03 User Guide → Chapter 7 Batch Processing. Caldera (1998). Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  13. If (en). Windows XP Professional Product Documentation. Microsoft. Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  14. Set (en). TechNet Library → MS-DOS. Microsoft. — Описание команды SET. Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  15. Q41246: How to Use Environment Variable Substitution in Batch Files (en). Microsoft (10 мая 2003). Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  16. Q69846: DOS Environment Table Description; Basic’s ENVIRON Statement (en). Microsoft (16 августа 2005). — Технические детали реализации окружения. Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  17. Shift (en). TechNet Library → MS-DOS. Microsoft. — Описание команды SHIFT. Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.
  18. 18,0 18,1 Q75634: Percent Signs Stripped from Batch File Text (en). Microsoft (10 мая 2003). Проверено 15 января 2010. Архивировано из первоисточника 14 февраля 2012.

Ссылки[]

  • Урок bat-аники RSDN
  • Ошибка скрипта: Модуля «String» не существует. COMMAND.COM (en). Windows 95/98/NT4/2000/ME/XP/2003 + DOS 7.xx/8.00 Tricks + Secrets Files. — Список всех опций COMMAND.COM, включая недокументированные. Проверено 16 января 2010.
  Компоненты Microsoft Windows
Основные

Aero •
ClearType •
Диспетчер рабочего стола •
DirectX •
Панель задач
(Пуск •

Область уведомлений) •
Проводник
(Пространство имён •

Специальные папки
Ассоциации файлов) •
Windows Search
(Smart folders

iFilters) •
GDI •
WIM
SMB •
.NET Framework •
XPS •
Active Scripting
(WSH •

VBScript •
JScript) •
COM
(OLE •

DCOM •
ActiveX •
Структурированное хранилище
Сервер транзакций) •
Теневая копия
WDDM •
UAA
Консоль Win32

Службы
управления

Архивация и восстановление
COMMAND.COM
cmd.exe •
Средство переноса данных •
Просмотр событий
Установщик •
netsh.exe
PowerShell •
Отчёты о проблемах
rundll32.exe •
Программа подготовки системы (Sysprep) •
Настройка системы (MSConfig) •
Проверка системных файлов
Индекс производительности •
Центр обновления •
Восстановление системы •
Дефрагментация диска
Диспетчер задач •
Диспетчер устройств •
Консоль управления •
Очистка диска •
Панель управления
(элементы)

Приложения

Контакты •
DVD Maker
Факсы и сканирование
Internet Explorer •
Журнал
Экранная лупа •
Media Center •
Проигрыватель Windows Media •
Программа совместной работы
Центр устройств Windows Mobile
Центр мобильности •
Экранный диктор
Paint •
Редактор личных символов
Удалённый помощник
Распознавание речи
WordPad •
Блокнот •
Боковая панель •
Звукозапись
Календарь
Калькулятор
Ножницы
Почта •
Таблица символов •
Исторические:
Movie Maker •

NetMeeting •
Outlook Express •
Диспетчер программ •
Диспетчер файлов •
Фотоальбом •
Windows To Go

Игры

Chess Titans •
Mahjong Titans
Purble Place •
Пасьянсы (Косынка
Паук
Солитер) •
Сапёр
Пинбол •
Червы

Ядро ОС

Ntoskrnl.exe •
Слой аппаратных абстракций (hal.dll) •
Бездействие системы •
svchost.exe •
Реестр •
Службы •
Диспетчер управления сервисами
DLL
(формат модулей) •

PE •
NTLDR •
Диспетчер загрузки
Программа входа в систему (winlogon.exe) •
Консоль восстановления
Windows RE
Windows PE •
Защита ядра от изменений

Службы

Autorun.inf •
Фоновая интеллектуальная служба передачи
Файловая система стандартного журналирования
Отчёты об ошибках
Планировщик классов мультимедиа
Теневая копия
Планировщик задач •
Беспроводная настройка

Файловые
системы

ReFS •
NTFS
(Жёсткая ссылка

Точка соединения •
Точка монтирования
Точка повторной обработки
Символьная ссылка •
TxF •
EFS) •
WinFS •
FAT •
exFAT •
CDFS •
UDF
DFS •
IFS

Сервер

Active Directory •
Службы развёртывания •
Служба репликации файлов
DNS
Домены
Перенаправление папок
Hyper-V •
IIS •
Media Services
MSMQ
Защита доступа к сети (NAP) •
Службы печати для UNIX
Удалённое разностное сжатие
Службы удаленной установки
Служба управления правами
Перемещаемые профили пользователей •
SharePoint •
Диспетчер системных ресурсов
Удаленный рабочий стол
WSUS •
Групповая политика •
Координатор распределённых транзакций

Архитектура

NT •
Диспетчер объектов
Пакеты запроса ввода/вывода
Диспетчер транзакций ядра
Диспетчер логических дисков
Диспетчер учетных записей безопасности
Защита ресурсов
lsass.exe
csrss.exe •
smss.exe •
spoolsv.exe
Запуск

Безопасность

BitLocker
Защитник •
Предотвращение выполнения данных
Обязательный контроль целостности
Защищённый канал данных
UAC •
UIPI
Брандмауэр •
Центр обеспечения безопасности •
Защита файлов

Совместимость

Подсистема UNIX (Interix) •
Виртуальная машина DOS •
Windows on Windows •
WOW64

Шаблон:OS/2 API

<div id=»mw-content-wrapper»><div id=»mw-content»><div id=»content» class=»mw-body» role=»main»><div id=»bodyContentOuter»><div class=»mw-body-content» id=»bodyContent»><div id=»mw-content-text» class=»mw-body-content mw-content-ltr» lang=»en» dir=»ltr»><div class=»mw-parser-output»><p class=»mw-empty-elt»>
</p><table class=»infobox»><caption class=»summary»>COMMAND.COM</caption><tbody><tr><td colspan=»2″ style=»text-align:center»><span class=»new» title=»File:Command.com Win10.png»>File:Command.com Win10.png</span><div>COMMAND.COM in <span title=»Software:Windows 10″>Windows 10</span></div></td></tr><tr><th scope=»row» style=»white-space: nowrap;»>Other names</th><td>MS-DOS Prompt,<br/>Windows Command Interpreter</td></tr><tr><th scope=»row» style=»white-space: nowrap;»><span title=»Programmer»>Developer(s)</span></th><td><span title=»Company:Seattle Computer Products»>Seattle Computer Products</span>, <span title=»Company:IBM»>IBM</span>, <span title=»Company:Microsoft»>Microsoft</span>, The Software Link, <span title=»Software:Datalight»>Datalight</span>, <span title=»Company:Novell»>Novell</span>, Caldera</td></tr><tr><th scope=»row» style=»white-space: nowrap;»>Initial release</th><td>1980<span class=»noprint»>; 44 years ago</span><span style=»display:none»> (<span class=»bday dtstart published updated»>1980</span>)</span></td></tr><tr><th scope=»row» style=»white-space: nowrap;»>Written in</th><td><span title=»X86″>x86</span> <span title=»Assembly language»>assembly language</span><sup id=»cite_ref-Microsoft_COMMAND_1-0″ class=»reference»><span></span></sup></td></tr><tr><th scope=»row» style=»white-space: nowrap;»><span title=»Operating system»>Operating system</span></th><td><div class=»plainlist»><ul><li><span title=»Software:86-DOS»>86-DOS</span></li><li><span title=»Software:MS-DOS»>MS-DOS</span></li><li>PC DOS</li><li><span title=»Software:DR-DOS»>DR-DOS</span></li><li><span title=»Software:SISNE plus»>SISNE plus</span></li><li><span title=»Software:PTS-DOS»>PTS-DOS</span></li><li><span class=»mw-redirect» title=»ROM-DOS»>ROM-DOS</span></li><li>OS/2</li><li><span title=»Software:Windows 9x»>Windows 9x</span></li><li><span title=»Software:Windows NT»>Windows NT</span> (NTVDM)</li><li><span title=»Software:FreeDOS»>FreeDOS</span></li><li><span title=»Software:MSX-DOS»>MSX-DOS</span></li></ul></div></td></tr><tr><th scope=»row» style=»white-space: nowrap;»><span title=»Computing platform»>Platform</span></th><td>16-bit <span title=»X86″>x86</span></td></tr><tr><th scope=»row» style=»white-space: nowrap;»>Successor</th><td><span title=»Software:Cmd.exe»>cmd.exe</span></td></tr><tr><th scope=»row» style=»white-space: nowrap;»><span title=»Software categories»>Type</span></th><td>Command-line interpreter</td></tr></tbody></table><p><b>COMMAND.COM</b> is the default command-line interpreter for <span title=»Software:MS-DOS»>MS-DOS</span>, <span title=»Software:Windows 95″>Windows 95</span>, <span title=»Software:Windows 98″>Windows 98</span> and <span title=»Software:Windows Me»>Windows Me</span>. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot (init process), hence being responsible for setting up the system by running the AUTOEXEC.BAT configuration file, and being the ancestor of all processes.
</p><p>COMMAND.COM&#39;s successor on OS/2 and <span title=»Software:Windows NT»>Windows NT</span> systems is <span title=»Software:Cmd.exe»>cmd.exe</span>, although COMMAND.COM is available in <span title=»Virtual DOS machine»>virtual DOS machines</span> on <span title=»IA-32″>IA-32</span> versions of those operating systems as well.
</p><p>The <style data-mw-deduplicate=»TemplateStyles:r4894″>.mw-parser-output .monospaced{font-family:monospace,monospace}</style><span class=»monospaced»>COMMAND.COM</span> filename was also used by Disk Control Program (de) (DCP), an MS-DOS derivative by the former East German <span title=»Company:VEB Robotron»>VEB Robotron</span>.<sup id=»cite_ref-DCP_2016_2-0″ class=»reference»><span></span></sup>
</p><p>The compatible command processor under <span title=»Software:FreeDOS»>FreeDOS</span> is sometimes also named FreeCom.
</p><p>COMMAND.COM is a DOS program. Programs launched from COMMAND.COM are DOS programs that use the <span title=»DOS API»>DOS API</span> to communicate with the disk operating system.
</p><h2 id=»qai_title_1″><span class=»mw-headline» id=»Operating_modes»>Operating modes</span></h2><p>As a shell, COMMAND.COM has two distinct modes of operation. The first is interactive mode, in which the user types commands which are then executed immediately. The second is <span title=»Software:Batch processing»>batch mode</span>, which executes a predefined sequence of commands stored as a text file with the <span title=»Batch file»>.BAT</span> extension.
</p><h2 id=»qai_title_2″><span class=»mw-headline» id=»Internal_commands»><span id=»Prompt»></span>Internal commands</span></h2><p>Internal commands are commands stored directly inside the COMMAND.COM binary. Thus, they are always available but can only be executed directly from the command interpreter.
</p><p>All commands are executed after the key is pressed at the end of the line. COMMAND.COM is not case-sensitive, meaning commands can be typed in any mixture of upper and lower case.
</p><dl><dt>BREAK</dt>
<dd>Controls the handling of program interruption with or .</dd>
<dt><span class=»mw-redirect» title=»Software:CHCP (command)»>CHCP</span></dt>
<dd>Displays or changes the current system <span title=»Code page»>code page</span>.</dd>
<dt>CHDIR, CD</dt>
<dd>Changes the current working directory or displays the current directory.</dd>
<dt><span class=»mw-redirect» title=»Software:CLS (DOS command)»>CLS</span></dt>
<dd>Clears the screen.</dd>
<dt>COPY</dt>
<dd>Copies one file to another (if the destination file already exists, MS-DOS asks whether to replace it). (See also XCOPY, an external command that could also copy directory trees).</dd>
<dt>CTTY</dt>
<dd>Defines the device to use for input and output.</dd>
<dt><span class=»mw-redirect» title=»Software:DATE (command)»>DATE</span></dt>
<dd>Display and set the date of the system.</dd>
<dt>DEL, ERASE</dt>
<dd>Deletes a file. When used on a directory, deletes all files inside the directory only. In comparison, the external command <span title=»Software:DELTREE»>DELTREE</span> deletes all subdirectories and files inside a directory as well as the directory itself.</dd>
<dt>DIR</dt>
<dd>Lists the files in the specified directory.</dd>
<dt>ECHO</dt>
<dd>Toggles whether text is displayed (<code class=»code2highlight lang-text» id=»» style=»display: inline;»>ECHO ON</code>) or not (<code class=»code2highlight lang-text» id=»» style=»display: inline;»>ECHO OFF</code>). Also displays text on the screen (<code class=»code2highlight lang-text» id=»» style=»display: inline;»>ECHO text</code>).</dd>
<dt>EXIT</dt>
<dd>Exits from COMMAND.COM and returns to the program which launched it.</dd>
<dt>LFNFOR</dt>
<dd>Enables or disables the return of long filenames by the FOR command. (<span title=»Software:Windows 9x»>Windows 9x</span>).</dd>
<dt><span title=»Software:LOADHIGH»>LOADHIGH, LH</span></dt>
<dd>Loads a program into upper memory (<code class=»code2highlight lang-text» id=»» style=»display: inline;»>HILOAD</code> in <span class=»mw-redirect» title=»Software:DR DOS»>DR DOS</span>).</dd>
<dt>LOCK</dt>
<dd>Enables external programs to perform low-level disk access to a volume. (MS-DOS 7.1 and <span title=»Software:Windows 9x»>Windows 9x</span> only)</dd>
<dt>MKDIR, MD</dt>
<dd>Creates a new directory.</dd>
<dt>PATH</dt>
<dd>Displays or changes the value of the PATH <span title=»Environment variable»>environment variable</span> which controls the places where COMMAND.COM will search for executable files.</dd>
<dt><span class=»mw-redirect» title=»Software:PROMPT (DOS command)»>PROMPT</span></dt>
<dd>Displays or change the value of the PROMPT environment variable which controls the appearance of the prompt.</dd>
<dt>RENAME, REN</dt>
<dd>Renames a file or directory.</dd>
<dt>RMDIR, RD</dt>
<dd>Removes an empty directory.</dd>
<dt>SET</dt>
<dd>Sets the value of an <span title=»Environment variable»>environment variable</span>; without arguments, shows all defined environment variables.</dd>
<dt><span title=»Software:TIME (command)»>TIME</span></dt>
<dd>Display and set the time of the system.</dd>
<dt>TRUENAME</dt>
<dd>Display the fully expanded physical name of a file, resolving ASSIGN, JOIN and SUBST logical filesystem mappings.<sup id=»cite_ref-Paul_1997_NWDOSTIP_3-0″ class=»reference»><span></span></sup></dd>
<dt><span title=»Software:TYPE (DOS command)»>TYPE</span></dt>
<dd>Display the content of a file on the console.</dd>
<dt>UNLOCK</dt>
<dd>Disables low-level disk access. (MS-DOS 7.1 and <span title=»Software:Windows 9x»>Windows 9x</span> only)</dd>
<dt>VER</dt>
<dd>Displays the version of the <span title=»Operating system»>operating system</span>.</dd>
<dt>VERIFY</dt>
<dd>Enable or disable verification of writing for files.</dd>
<dt>VOL</dt>
<dd>Shows information about a volume.</dd></dl><h2 id=»qai_title_3″><span class=»mw-headline» id=»Batch_file_commands»>Batch file commands</span></h2><p>Control structures are mostly used inside batch files, although they can also be used interactively.<sup id=»cite_ref-Caldera_1998_USER_CH7_4-0″ class=»reference»><span></span></sup><sup id=»cite_ref-Paul_1997_NWDOSTIP_3-1″ class=»reference»><span></span></sup>
</p><dl><dt>:<i>label</i></dt>
<dd>Defines a target for GOTO.</dd>
<dt><span class=»mw-redirect» title=»Software:CALL (DOS command)»>CALL</span></dt>
<dd>Executes another batch file and returns to the old one and continues.</dd>
<dt>FOR</dt>
<dd>Iteration: repeats a command for each out of a specified set of files.</dd>
<dt>GOTO</dt>
<dd>Moves execution to a specified label. Labels are specified at the beginning of a line, with a colon (<code class=»code2highlight lang-text» id=»» style=»display: inline;»>:likethis</code>).</dd>
<dt><span class=»mw-redirect» title=»Software:IF (DOS command)»>IF</span></dt>
<dd>Conditional statement, allows branching of the program execution.</dd>
<dt>PAUSE</dt>
<dd>Halts execution of the program and displays a message asking the user to press any key to continue.</dd>
<dt><span class=»mw-redirect» title=»Software:REM (DOS command)»>REM</span></dt>
<dd><span title=»Comment (computer programming)»>comment</span>: any text following this command is ignored.</dd>
<dt><span class=»mw-redirect» title=»Software:SHIFT (DOS command)»>SHIFT</span></dt>
<dd>Replaces each of the replacement parameters with the subsequent one (e.g. <code class=»code2highlight lang-text» id=»» style=»display: inline;»>%0</code> with <code class=»code2highlight lang-text» id=»» style=»display: inline;»>%1</code>, <code class=»code2highlight lang-text» id=»» style=»display: inline;»>%1</code> with <code class=»code2highlight lang-text» id=»» style=»display: inline;»>%2</code>, etc.).</dd></dl><h2 id=»qai_title_4″><span class=»mw-headline» id=»IF_command»>IF command</span></h2><p>On exit, all external commands submit a <span title=»Software:Return code»>return code</span> (a value between 0 and 255) to the calling program. Most programs have a certain convention for their return codes (for instance, 0 for a successful execution).<sup id=»cite_ref-Paul_1997_BATTIPS_5-0″ class=»reference»><span></span></sup><sup id=»cite_ref-FD_2003_Errorlevel_6-0″ class=»reference»><span></span></sup><sup id=»cite_ref-Paul_2003_Exitcodes_7-0″ class=»reference»><span></span></sup><sup id=»cite_ref-Allen_2005_8-0″ class=»reference»><span></span></sup>
</p><p>If a program was invoked by COMMAND.COM, the internal IF command with its ERRORLEVEL conditional can be used to test on error conditions of the last invoked external program.
</p><p>Under COMMAND.COM, internal commands do not establish a new value.
</p><h2 id=»qai_title_5″><span class=»mw-headline» id=»Variables»>Variables</span></h2><p>Batch files for COMMAND.COM can have four kinds of variables:
</p><ul><li><span title=»Environment variable»>Environment variables</span>: These have the <link rel=»mw-deduplicated-inline-style»/><span class=»monospaced»>%VARIABLE%</span> form and are associated with values with the SET statement. Before DOS 3 COMMAND.COM will only expand environment variables in batch mode; that is, not interactively at the command prompt.<sup class=»noprint Inline-Template Template-Fact» style=»white-space:nowrap;»>[<i></i>]</sup></li><li>Replacement parameters: These have the form <link rel=»mw-deduplicated-inline-style»/><span class=»monospaced»>%0</span>, <link rel=»mw-deduplicated-inline-style»/><span class=»monospaced»>%1</span>…<link rel=»mw-deduplicated-inline-style»/><span class=»monospaced»>%9</span>, and initially contain the command name and the first nine command-line parameters passed to the script (e.g., if the invoking command was <kbd style=»background:#EEEEEE; letter-spacing:0.05em; padding-left:0.25em; padding-right:0.2em;»>myscript.bat John Doe</kbd>, then <link rel=»mw-deduplicated-inline-style»/><span class=»monospaced»>%0</span> is &#34;myscript.bat&#34;, <link rel=»mw-deduplicated-inline-style»/><span class=»monospaced»>%1</span> is &#34;John&#34; and <link rel=»mw-deduplicated-inline-style»/><span class=»monospaced»>%2</span> is &#34;Doe&#34;). The parameters to the right of the ninth can be mapped into range by using the SHIFT statement.</li><li>Loop variables: Used in loops, they have the <link rel=»mw-deduplicated-inline-style»/><span class=»monospaced»>%%a</span> format when run in batch files. These variables are defined solely within a specific FOR statement, and iterate over a certain set of values defined in that FOR statement.</li><li>Under Novell DOS 7, OpenDOS 7.01, DR-DOS 7.02 and higher, COMMAND.COM also supports a number of system information variables,<sup id=»cite_ref-Caldera_1998_USER_CH7_4-1″ class=»reference»><span></span></sup><sup id=»cite_ref-Caldera_1998_USER_9-0″ class=»reference»><span></span></sup><sup id=»cite_ref-Paul_1997_NWDOSTIP_3-2″ class=»reference»><span></span></sup> a feature earlier found in 4DOS 3.00 and higher<sup id=»cite_ref-4DOS_8.00_HELP_10-0″ class=»reference»><span></span></sup> as well as in <span title=»Software:Multiuser DOS»>Multiuser DOS</span>,<sup id=»cite_ref-Paul_1997_NWDOSTIP_3-3″ class=»reference»><span></span></sup> although most of the supported variable names differ.</li></ul><h2 id=»qai_title_6″><span id=»Redirection.2C_piping.2C_and_chaining»></span><span class=»mw-headline» id=»Redirection,_piping,_and_chaining»>Redirection, piping, and chaining</span></h2><p>Because DOS is a single-tasking operating system, <span title=»Software:Pipeline»>piping</span> is achieved by running commands sequentially, redirecting to and from a <span title=»Temporary file»>temporary file</span>. COMMAND.COM makes no provision for redirecting the <span title=»Standard streams»>standard error</span> channel.
</p><dl><dt><code><i>command</i> &lt; <i>filename</i></code></dt>
<dd>Redirect <span title=»Standard streams»>standard input</span> from a file or device</dd>
<dt><code><i>command</i> &gt; <i>filename</i></code></dt>
<dd>Redirect <span title=»Standard streams»>standard output</span>, overwriting target file if it exists.</dd>
<dt><code><i>command</i> &gt;&gt; <i>filename</i></code></dt>
<dd>Redirect <span title=»Standard streams»>standard output</span>, appending to target file if it exists.</dd>
<dt><code><i>command1</i> | <i>command2</i></code></dt>
<dd>Pipe <span title=»Standard streams»>standard output</span> from <i>command1</i> to <span title=»Standard streams»>standard input</span> of <i>command2</i></dd>
<dt><code><i>command1</i> ¶ <i>command2</i></code></dt>
<dd></dd>
<dd>Commands separated by ASCII-20 (¶, invoked by ) are executed in sequence (chaining of commands).<sup id=»cite_ref-Paul_1997_NWDOSTIP_3-4″ class=»reference»><span></span></sup> In other words, first <i>command1</i> is executed until termination, then <i>command2</i>.<sup id=»cite_ref-Paul_1997_NWDOSTIP_3-5″ class=»reference»><span></span></sup> This is an undocumented feature in COMMAND.COM of MS-DOS/PC DOS 5.0 and higher.<sup id=»cite_ref-Paul_1997_NWDOSTIP_3-6″ class=»reference»><span></span></sup> It is also supported by COMMAND.COM of the Windows NT family as well as by DR-DOS 7.07. All versions of DR-DOS COMMAND.COM already supported a similar internal function utilizing an exclamation mark (!) instead (a feature originally derived from <span class=»mw-redirect» title=»Software:Concurrent DOS»>Concurrent DOS</span> and <span title=»Software:Multiuser DOS»>Multiuser DOS</span>) — in the single-user line this feature was only available internally (in built-in startup scripts like &#34;!DATE!TIME&#34;) and indirectly through <span title=»Software:DOSKEY»>DOSKEY</span>&#39;s $T parameter to avoid problems with ! as a valid filename character.<sup id=»cite_ref-Paul_1997_NWDOSTIP_3-7″ class=»reference»><span></span></sup> <span title=»Software:4DOS»>4DOS</span> supports a configurable command line separator (4DOS.INI CommandSep= or SETDOS /C), which defaults to ^.<sup id=»cite_ref-4DOS_8.00_HELP_10-1″ class=»reference»><span></span></sup> COMMAND.COM in newer versions of Windows NT also supports an <code class=»code2highlight lang-text» id=»» style=»display: inline;»>&amp;</code> separator for compatibility with the cmd syntax in OS/2 and the Windows NT family.<sup id=»cite_ref-4DOS_8.00_HELP_10-2″ class=»reference»><span></span></sup> (cmd does not support the ¶ separator.)</dd></dl><h2 id=»qai_title_7″><span class=»mw-headline» id=»Limitations»>Limitations</span></h2><p>Generally, the command line length in interactive mode is limited to 126 characters.<sup id=»cite_ref-Paul_1997_MSDOS_11-0″ class=»reference»><span></span></sup><sup id=»cite_ref-Paul_1997_4DOSTIP_12-0″ class=»reference»><span></span></sup><sup id=»cite_ref-Schulman_1994_Undocumented-DOS_13-0″ class=»reference»><span></span></sup> In MS-DOS 6.22, the command line length in interactive mode is limited to 127 characters.
</p><h2 id=»qai_title_8″><span class=»mw-headline» id=»In_popular_culture»>In popular culture</span></h2><p>The message &#34;Loading COMMAND.COM&#34; can be seen on a HUD view of the Terminator and the internal viewport of RoboCop when he reboots.
</p><p>In the computer-animated children&#39;s TV series <i>ReBoot</i>, which takes place inside computers, the leader of a system (the equivalent of a city) is called the COMMAND.COM.
</p></div></div></div></div></div></div></div>

208

0

COMMAND.COM Troubleshoot and Download

Sometimes Windows system displays error messages regarding corrupted or missing COMMAND.COM files. Situations like that can occur, for example, during a software installation process. Each software program requires certain resources, libraries, and source data to work properly. Corrupted or nonexistent COMMAND.COM file can therefore effect in failed execution of the started process.

COMMAND.COM file DOS Command. The file was developed by Microsoft for use with Windows software. Here you will find detailed information about the file and instructions how to proceed in the event of COMMAND.COM related errors on your device. You can also download COMMAND.COM file compatible with Windows 10, Windows 8, Windows XP, Windows 8.1 devices which will (most probably) allow you to solve the problem.

Compatible with: Windows 10, Windows 8, Windows XP, Windows 8.1

User popularity

  • 1 Information about COMMAND.COM file
  • 2 Errors related to COMMAND.COM file
  • 3 How to fix COMMAND.COM related errors?
    • 3.1 Scanning for malicious software
    • 3.2 System and driver update
    • 3.3 System File Checker tool
    • 3.4 System recovery
  • 4 Download COMMAND.COM
    • 4.1 List of COMMAND.COM file versions

File info

General information
Filename COMMAND.COM
File extension COM
Type Executable Application
Description DOS Command
Software
Program Windows 10
Software Windows
Author Microsoft
Software version 10
Details
File size 8960
Oldest file 2008-04-14
MIME type application/octet-stream

COMMAND.COM

There are various types of errors related to COMMAND.COM file. COMMAND.COM file may be located in wrong file directory on your device, may not be present in the system, or may be infected with malicious software and therefore not work correctly. Below is a list of most common error messages related to COMMAND.COM file. If you encounter one listed below (or similar), please consider the following suggestions.

  • COMMAND.COM is corrupted
  • COMMAND.COM cannot be located
  • Runtime Error — COMMAND.COM
  • COMMAND.COM file error
  • COMMAND.COM file cannot be loaded. Module was not found
  • cannot register COMMAND.COM file:
  • COMMAND.COM file could not be loaded
  • COMMAND.COM file doesn’t exist

COMMAND.COM

Application could not be started because COMMAND.COM file is missing. Reinstall the application to solve the problem.

OK

Problems related to COMMAND.COM can be addressed in various ways. Some methods are meant only for advanced users. If you don’t have confidence in your skills, we suggest consulting a specialist. Fixing COMMAND.COM file errors should be approached with utmost caution for any mistakes can result in unstable or unproperly working system. If you have the necassary skills, please proceed.

COMMAND.COM file errors can be caused by various factors, so its is beneficial to try to fix them using various methods.

Step 1: Scan your computer for any malicious software

Windows files are commonly attacked by malicious software that prevents them from working properly. First step in addressing problems with COMMAND.COM file or any other Windows system files should be scanning the system for malicious software using an antivirus tool.

If by any chance you don’t have any antivirus software installed on your system yet, you should do it immediately. Unprotected system is not only a source of file errors, but, more importantly, makes your system vulnerable to many dangers. If you don’t know which antivirus tool to choose, consult this Wikipedia article – comparison of antivirus software.

Step 2: Update your system and drivers.

Installing relevant Microsoft Windows patches and updates may solve your problems related to COMMAND.COM file. Use dedicated Windows tool to perform the update.

  1. Go to the Windows «Start» menu
  2. Type «Windows Update» in the search field
  3. Choose the appropriate software program (name may vary depending on your system version)
  4. Check if your system is up to date. If any unapplied updates are listed, install them immediately.
  5. After the update has been done,restart your computer in order to complete the process.

Beside updating the system, it is recommended that you install latest device drivers, as drivers can influence proper working of COMMAND.COM or other system files. In order to do so, go to your computer or device producer’s website where you will find information regarding latest driver updates.

Step 4: Restoring Windows system

Another approach is to restore system to previous state, before the COMMAND.COM file error occured. In order to restore your system, follow the instructions below

  1. Go to the Windows «Start» menu
  2. Type «System Restore» in the search field
  3. Start the system restore tool – it’s name may differ depending on version of the system
  4. The application will guide you through the process – read the messages carefully
  5. After the process has finished, restart your computer.

If all the above-mentioned methods failed and the COMMAND.COM file problem has not been resolved, proceed to the next step. Remember that the following steps are intended only for advanced users.

Download and replace COMMAND.COM file

The last solution is to manually download and replace COMMAND.COM file in appropriate folder on the disk. Select file version compatible with your operating system and click the «Download» button. Next, go to your web browser’s «Downloaded» folder and copy the downloaded COMMAND.COM file.

Go to the folder where the file should be located and paste the downloaded file. Below is the list of COMMAND.COM file example directory paths.

  • Windows 10: C:\Windows\System32\
  • Windows 8: 1: C:\Windows\System32\
  • Windows XP: C:\Windows\System32\
  • Windows 8.1:

If the steps did not solve your COMMAND.COM file problem, you should consult a professional. A probability exists that the error(s) might be device-related and therefore should be resolved at the hardware level. A fresh operating system installation might be necessary – a faulty system installation process can result in data loss.

File versions list

Filename
COMMAND.COM

System
Windows 10

File size
8960 bytes

Date
2013-08-22

File details
MD5 9a355b75137e8a5f3c384c999cc6dbbc
SHA1 2be21636f3c2899f1217c289351b106118a5e197
SHA256 126a00e34a6516c0d382a221071ab4084031c2a89ccb6144cab960ce1f86ee2c
CRC32 2b4e36e7
Example file location C:\Windows\System32\

Filename
COMMAND.COM

System
Windows 8

File size
50648 bytes

Date
2012-07-25

File details
MD5 ba597f9a4bb90f038266ce1a3c3be3fb
SHA1 8ad4cc6d2dc92180ee6605fc3d205ed77716d490
SHA256 a5883b188b51aff06c54dabb56f6bdfec79e82f592466b0d9450b07166f989ab
CRC32 6d56470c
Example file location 1: C:\Windows\System32\

Filename
COMMAND.COM

System
Windows XP

File size
50620 bytes

Date
2008-04-14

File details
MD5 be67d29ca914de072d9971e3fffc4050
SHA1 3c57a09706d1791ef7cdbe65e62649e52c014e0f
SHA256 1a06fd74cead8820da111c42312a517aa239931f6bdc8c5fe8f586bc7e1a4ace
CRC32 6751750b
Example file location C:\Windows\System32\

Filename
COMMAND.COM

System
Windows 8.1

File size
8960 bytes

Date
2013-08-22

File details
MD5 9a355b75137e8a5f3c384c999cc6dbbc
SHA1 2be21636f3c2899f1217c289351b106118a5e197
SHA256 126a00e34a6516c0d382a221071ab4084031c2a89ccb6144cab960ce1f86ee2c
CRC32 2b4e36e7
Example file location

Check COM Ports in the Device Manager

The Device Manager is the easiest way to see the list of your available ports. Generally, if you want to inspect your PC’s components, it’s the first place to look. There are multiple ways to open the Device Manager to see Windows 10 COM ports:

Press Win+X, and select it from the newly opened menu.

The system tool menu available from Win+X

Press Win+R to open the Run prompt, and type in devmgmt.msc.

The Run window, ready to launch the Device Manager

Simply type “Device” into the search bar, and find it in the search results.

Windows Search automatically completing

If you have problems with COM ports not showing in Device Manager, this could be caused by a different version of Windows that hides them by default, a technical issue with your motherboard, or a lack of drivers for a USB-to-serial adapter.

How to Find COM Ports on Windows 10

  1. Open the Device Manager.

An overview of the Device Manager

  1. Optionally, enable “View” → “Show Hidden Devices”.
  1. Locate “Ports (COM and LPT)”.

The Ports category is highlighted and expanded, revealing COM1 and COM2

You can now right-click any individual port to view their Windows 10 COM port settings, and possibly disable them or update their drivers.

List COM Ports — Windows 10 Command Line Solution

If you’d want to know how to view COM ports in Windows 10 through the Command Prompt, it’s easy, but first you need to launch CMD. This is done by entering “cmd” in the Run prompt, which is opened with Win+R.

Once the terminal is opened, type mode and confirm by pressing Enter. You will get data on the available ports and their settings.

The output of

Some details on how to check COM port in Windows 11 are different, since the addition of the Windows Terminal.

What Port Am I Using?

COM ports are simple — unlike USB, the devices won’t identify themselves. Thus, the only way to see if anything is connected to a Windows 10 COM port is to receive a message from the connected device. This can be done with PowerShell. Before trying this approach, you’ll need to find the correct settings to be used when communicating with the device, including the baud rate, parity bits, etc.

How to Find what COM Port a Device is On

  1. Open PowerShell by pressing Win+X and selecting “Windows PowerShell (Admin)”.

The PowerShell administrator option highlighted in the Win+X menu

  1. Add the port as an object:
    $port = New-Object System.IO.Ports.SerialPort [port name],[baud rate],[parity],[data bits],[stop bits]
  2. Open the port with the $port.Open() command.

The $port object is created and opened

  1. You can now read a single line from the port or send a message to it by running $port.WriteLine() or $port.ReadLine().

A test message is sent, and $port is waiting to read a line

ReadLine will keep running until it receives one line of data. If you want to read from the port continuously, this is best done with a serial terminal application.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Основные защитные механизмы ос семейства windows
  • Как зарегистрировать файл dll windows 10 x64
  • Как открыть презентацию в формате key на windows
  • Программа гараж бэнд для windows
  • Посчитать количество строк в файле windows