...

Программа cmd что это такое

Команды Windows

Все поддерживаемые версии Windows и Windows Server имеют встроенный набор команд консоли Win32. В этом наборе документации описаны команды Windows, которые можно использовать для автоматизации задач с помощью скриптов или средств сценариев.

Оболочки командной строки

В Windows есть две оболочки командной строки: командная оболочка и PowerShell. Каждая оболочка представляет собой программную программу, которая обеспечивает прямую связь между вами и операционной системой или приложением, предоставляя среду для автоматизации ИТ-операций.

Командная оболочка была первой оболочкой, встроенной в Windows для автоматизации стандартных задач, таких как управление учетными записями пользователей или ночное резервное копирование, с пакетными (.bat) файлами. С помощью узла сценариев Windows можно запускать более сложные скрипты в командной оболочке. Дополнительные сведения см. в разделе cscript или wscript. Операции можно выполнять более эффективно с помощью скриптов, чем с помощью пользовательского интерфейса. Скрипты принимают все команды, доступные в командной строке.

PowerShell был разработан для расширения возможностей командной оболочки для выполнения команд PowerShell, называемых командлетами. Командлеты похожи на команды Windows, но предоставляют более расширяемый язык сценариев. В PowerShell можно выполнять как команды Windows, так и командлеты PowerShell, но командная оболочка может выполнять только команды Windows, но не командлеты PowerShell.

Для наиболее надежной и актуальной автоматизации Windows рекомендуется использовать PowerShell вместо команд Windows или узла сценариев Windows для автоматизации Windows.

Справочник по кодам выхода и ошибок для команд Windows можно найти в статьях Коды системных ошибок отладки , которые могут быть полезны для понимания создаваемых ошибок. Команды Windows также включают операторы перенаправления команд. Дополнительные сведения об их использовании см. в статье Использование операторов перенаправления команд.

Вы также можете скачать и установить PowerShell Core, открытый код версию PowerShell.

Автоматическое завершение файла командной оболочки и имени каталога

Вы можете настроить командную оболочку для автоматического завершения имен файлов и каталогов на компьютере или в сеансе пользователя при нажатии указанного управляющего символа. По умолчанию этот символ элемента управления настроен как клавиша табуляции для имен файлов и каталогов, хотя они могут быть разными. Чтобы изменить этот символ элемента управления, выполните команду regedit.exe и перейдите к любой из следующих разделов реестра и записей в зависимости от того, хотите ли вы изменить значение только для текущего пользователя или для всех пользователей компьютера.

Неправильное изменение реестра может серьезно повредить систему. Перед внесением следующих изменений в реестр необходимо создать резервную копию всех важных данных на компьютере.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\CompletionChar HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\PathCompletionChar 

Присвойте этим значениям значение элемента управления, который вы хотите использовать. Полный список см. в разделе Коды виртуальных ключей . Чтобы отключить определенный символ завершения в реестре, используйте значение пробела (0x20), так как оно не является допустимым управляющим символом. Тип значения для этой записи реестра REG_DWORD, а также может быть указан шестнадцатеричным или десятичным значением.

Вы также можете включить или отключить завершение имени файла и каталога для каждого экземпляра командной оболочки, выполнив команду cmd.exe с параметром и параметром /F:ON или /F:OFF . Если с параметром и параметром /F:ON включено заполнение имени, используются Ctrl-D два управляющих символа для завершения имени каталога и Ctrl-F для завершения имени файла. Пользовательские параметры имеют приоритет над параметрами компьютера, а параметры командной строки имеют приоритет над параметрами реестра.

Справочник по командной строке A–Z

Чтобы найти сведения о конкретной команде, в следующем меню A–Z выберите букву, с которой начинается команда, а затем выберите имя команды.

A

B

  • bcdboot
  • bcdedit
  • bdehdcfg
    • bdehdcfg driveinfo
    • bdehdcfg newdriveletter
    • bdehdcfg quiet
    • bdehdcfg restart
    • bdehdcfg size
    • bdehdcfg target
    • bitsadmin addfile
    • bitsadmin addfileset
    • bitsadmin addfilewithranges
    • bitsadmin cache
      • bitsadmin cache и delete
      • bitsadmin cache и deleteurl
      • bitsadmin cache и getexpirationtime
      • bitsadmin cache и getlimit
      • bitsadmin cache и help
      • bitsadmin cache и info
      • bitsadmin cache и list
      • bitsadmin cache и setexpirationtime
      • bitsadmin cache и setlimit
      • bitsadmin cache и clear
      • bitsadmin peercaching и getconfigurationflags
      • bitsadmin peercaching и help
      • bitsadmin peercaching и getconfigurationflags
      • bitsadmin peers и clear
      • bitsadmin peers и discover
      • bitsadmin peers и help
      • bitsadmin peers и list
      • bitsadmin util и enableanalyticchannel
      • bitsadmin util и getieproxy
      • bitsadmin util и help
      • bitsadmin util и repairservice
      • bitsadmin util и setieproxy
      • bitsadmin util и version
      • bootcfg addsw
      • bootcfg copy
      • bootcfg dbg1394
      • bootcfg debug
      • bootcfg default
      • bootcfg delete
      • bootcfg ems
      • bootcfg query
      • bootcfg raw
      • bootcfg rmsw
      • bootcfg timeout

      Программа cmd что это такое

      Starts a new instance of the command interpreter, Cmd.exe. If used without parameters, cmd displays the version and copyright information of the operating system.

      Syntax

      cmd [/c|/k] [/s] [/q] [/d] [/a|/u] [/t: | >] [/e:] [/f:] [/v:] [] 

      Parameters

      Parameter Description
      /c Carries out the command specified by and then exits the command processor.
      /k Carries out the command specified by and keeps the command processor running.
      /s When used with /c or /k , triggers special non-parsing rules that strip the first and last quotes ( » ) around the but leaves the rest of the command unchanged.
      /q Turns echo off.
      /d Disables execution of AutoRun commands.
      /a Formats command output as American National Standards Institute (ANSI).
      /u Formats command output as Unicode.
      /t:< | > Sets the background (b) and foreground (f) colors.
      /e:on Enables command extensions.
      /e:off Disables commands extensions.
      /f:on Enables file and directory name completion.
      /f:off Disables file and directory name completion.
      /v:on Enables delayed environment variable expansion.
      /v:off Disables delayed environment variable expansion.
      Specifies the command you want to carry out.
      /? Displays help at the command prompt.

      The following table lists valid hexadecimal digits that you can use as the values for and :

      Value Color
      0 Black
      1 Blue
      2 Green
      3 Aqua
      4 Red
      5 Purple
      6 Yellow
      7 White
      8 Gray
      9 Light blue
      a Light green
      b Light aqua
      c Light red
      d Light purple
      e Light yellow
      f Bright white

      Remarks

      • To redirect command output to the input of another command, use the pipe ( | ) character. For example:
      mkdir Test&&mkdir "Test 2"&&move "Test 2" Test 
      • You don’t also use /s .
      • You use exactly one set of quotation marks.
      • You don’t use any special characters within the quotation marks (for example: & < >( ) @ ^ | ).
      • You use one or more white-space characters within the quotation marks.
      • The within quotation marks is the name of an executable file.

      If the previous conditions aren’t met, is processed by examining the first character to verify whether it’s an opening quotation mark. If the first character is an opening quotation mark, it’s stripped along with the closing quotation mark. Any text following the closing quotation marks is preserved.

      • HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun\REG_SZ
      • HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun\REG_EXPAND_SZ

      If one or both registry subkeys are present, they’re executed before all other variables.

      Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.

      • HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions\REG_DWORD
      • HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions\REG_DWORD

      Set the REG_DWORD value to either 0×1 (enabled) or 0×0 (disabled) in the registry by using Regedit.exe. User-specified settings take precedence over computer settings, and command-line options take precedence over registry settings.

      Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.

      • assoc
      • call
      • chdir ( cd )
      • color
      • del ( erase )
      • endlocal
      • for
      • ftype
      • goto
      • if
      • mkdir ( md )
      • popd
      • prompt
      • pushd
      • set
      • setlocal
      • shift
      • start (also includes changes to external command processes)
      • HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar\REG_DWORD
      • HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\PathCompletionChar\REG_DWORD
      • HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar\REG_DWORD
      • HKEY_CURRENT_USER\Software\Microsoft\Command Processor\PathCompletionChar\REG_DWORD

      To set the REG_DWORD value, run Regedit.exe and use the hexadecimal value of a control character for a particular function (for example, 0×9 is TAB and 0×08 is BACKSPACE). Use the [0×20] value for white space, because it isn’t a valid control character. User-specified settings take precedence over computer settings, and command-line options take precedence over registry settings.

      Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.

      • To move through the list of matching paths, press CTRL+D or CTRL+F repeatedly.
      • To move through the list backwards, press the SHIFT key and CTRL+D or CTRL+F simultaneously.
      • To discard the saved list of matching paths and generate a new list, edit and press CTRL+D or CTRL+F.
      • If you switch between CTRL+D and CTRL+F, the saved list of matching paths is discarded, and a new list is generated.

      Related links

      При подготовке материала использовались источники:
      https://learn.microsoft.com/ru-ru/windows-server/administration/windows-commands/windows-commands
      https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmd

Оцените статью