複製鏈接
請複製以下鏈接發送給好友

cmd.exe

(微軟Windows系統命令行程序)

鎖定
cmd.exe是微軟Windows系統的命令行程序(可解釋為Commander.exe),類似於微軟的DOS操作系統。cmd.exe是一個16/32位的命令行程序,運行在Windows NT/Windows 2000/Windows XP/Windows 2003/Windows Vista/Windows 7/Windows 8/Windows 10上。這不是純粹的系統程序,但是如果終止它,可能會導致未知的問題。
外文名
cmd.exe
進程名稱
Windows 命令提示符
出品者
Microsoft Corporation

目錄

cmd.exe簡介

cmd.exe
cmd.exe(5張)
進程文件: cmd 或者 cmd.exe
描述:
cmd.exe是微軟Windows系統的命令行程序,類似於微軟的DOS操作系統。cmd.exe是一個16/32位的命令行程序,運行在Windows NT/2000/XP/2003/Vista/7/8上。這不是純粹的系統程序,但是如果終止它,可能會導致未知的問題。
使用網絡: 部分命令使用
硬件相關: 部分命令相關
常見錯誤: 操作失敗
內存使用: 未知
安全等級 (0-5): 0
安全性:部分情況可被木馬利用
cmd.exe是基於Windows CEWindows NT操作系統(包括Windows 2000 , XP, Vista,7以及Windows8,Windows10中,和Server 2003 )的命令行編譯程序 。它類似於在MS - DOS和Windows 9X的系統中的 command. com,或Unix系統使用的shell。

cmd.exeVer

Therese Stowell developed the initial version of cmd.exe for Windows NT.[1] Although some old DOS commands are not supported or have been changed (e.g. the functionality of deltree.exe was rolled into RD in the form of the /s parameter), cmd.exe still has a greater number of built-in commands.
Both the OS/2 and the Windows NT versions of cmd.exe have more detailed error messages than the blanket "Bad command or file name" (in the case of malformed commands) of command .com. In the OS/2 version of cmd.exe, errors are reported in whatever the current language of system is, their text being taken from the system message files. The help command can then be issued with the error message number to obtain further information.
cmd.exe, which remains part of Windows Vista and Windows Server 2008 for backward compatibility, will be supplemented with Windows PowerShell, Microsoft's new extensible command line shell and task-based scripting technology.
版本
Therese stowell為Windows NT開發了cmd.exe 的最初版本。
[ 1 ] ,雖然有些舊的DOS命令已不被支持,或已改變(如deltree.exe的功能性集成進了RD的/ s參數中) ,cmd.exe仍然具有數量龐大的內建命令。
OS / 2和Windows NT這兩個版本的cmd.exe都有更詳細的錯誤訊息,相比於 command .com中的“錯誤的命令或文件名” (如屬惡意命令) 。在OS/ 2版本的cmd.exe中,錯誤的報告會以當前計算機設置的語言來顯示,顯示的文本儲存在系統信息文件中。 help命令可以給出一個錯誤編號,用户可以利用錯誤編號查詢更多的相關信息。
cmd.exe ,仍然被保留為Windows Vista和Windows Server 2008的一部分以便向後兼容, 並會隨着Windows PowerShell ,微軟新的可擴展命令行外殼和基於任務的腳本技術在未來進行增補。

cmd.exeTI

Technically
Technically(5張)
Unlike COMMA ND. COM, which is a DOS program, cmd.exe is a native program for the platform. This allows it to take advantage of features available to native programs on the platform and not available to DOS programs. For example, since cmd.exe is a native text-mode application on OS/2 it can use real pipes in command pipelines, allowing both sides of the pipeline to run concurrently. As a result, it is possible to redirect the standard error in cmd.exe, unlike COM MAND. COM. (COMM AND. COM uses temporary files, and runs the two sides serially, one after the other.)
Technically, cmd.exe is a Windows program that acts as a DOS-like command line interpreter. It is generally compatible, but provides extensions which address the limitations of COMMAN D. COM:
* SETLOCAL/ENDLOCAL commands limit the scope of changes to the environment
* internal CALL and GOTO labels lessen the need for individual batch files to perform parts of a task.
* filename-parsing extensions to the SET command are comparable to C shell.
* an expression-evaluation extensions is also provided in the SET command.
The extensions can be disabled, providing a stricter compatibility mode.
不像command. com ,那是一個DOS程序, cmd.exe是一個為系統平台服務的本機程序。讓它可以利用平台上本機程序的可用功能,對dos程序不可用。例如,由於cmd.exe是在OS / 2上的一個本機文本模式應用程序 ,它可以使用指令通道中的實際通道,讓通道兩邊同時執行指令。這樣以來,有可能在cmd.exe 中造成標準誤差發生改變,不像command .com 。 ( comma nd. com使用的是臨時文件,並相繼以串行方式運行雙方指令) 。
在技術上, cmd.exe是一個Windows程序,作為一個DOS的命令行解釋程序。它普遍兼容,但又提供擴展,用來處理command. com中的侷限性 :
* setlocal / endlocal命令限制環境改變的適用範圍
*內部“通話”和“轉到”標籤縮小了個別批處理文件去執行任務的某一部分的需求。
*文件名-解析擴展“set”命令媲美到C shell。
*表達評價的擴展還提供了在set命令。
擴展可以禁用,提供了更嚴密的兼容模式。

cmd.execmd.exe命令參數

CMD [/A | /U] [/Q] [/D][/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF][[/S] [/C | /K] string]
/C 執行字符串指定的命令然後終斷
/K 執行字符串指定的命令但保留
/S 在 /C 或 /K 後修改字符串處理(見下)
/Q 關閉迴應
/D 從註冊表中停用執行 AutoRun 命令(見下)
/A 使向內部管道或文件命令的輸出成為 ANSI
/U 使向內部管道或文件命令的輸出成為 Unicode
/T:fg 設置前景/背景顏色(詳細信息,請見 COLOR /?)
/E:ON 啓用命令擴展(見下)
/E:OFF 停用命令擴展(見下)
/F:ON 啓用文件和目錄名稱完成字符 (見下)
/F:OFF 停用文件和目錄名稱完成字符(見下)
/V:ON 將 ! 作為定界符啓動延緩環境變量擴展。如: /V:ON 會允許 !var! 在執行時允許 !var! 擴展變量 var。
/V:OFF 停用延緩的環境擴展。
如果指定了 /C 或 /K,命令行開關後的命令行其餘部分將作為命令行處
理;在這種情況下,會使用下列邏輯處理引號字符("):
1. 如果符合下列所有條件,那麼在命令行上的引號字符將被保留:
- 不帶 /S 命令行開關
- 整整兩個引號字符
- 在兩個引號字符之間沒有特殊字符,特殊字符為下列中的 一個:
<>()@^|
- 在兩個引號字符之間有至少一個空白字符
- 在兩個引號字符之間有至少一個可執行文件的名稱。
2. 否則,老辦法是,看第一個字符是否是一個引號字符,如果 是,捨去開頭的字符並刪除命令行上 的最後一個引號字符,
保留最後一個引號字符之後的文字。
如果 /D 未在命令行上被指定,當 CMD.EXE 開始時,它會尋找以下 REG_SZ/REG_EXPAND_SZ 註冊表變量。如果其中一個或兩個都存在,這兩個變量會先被執行。
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
和/或
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
命令擴展是按默認值啓用的。您也可以使用 /E:OFF,為某一特定調用而停用擴展。您可以在機器上和/或用户登錄會話上啓用或停用 CMD.EXE 所有調用的擴展,這要通過設置使用
REGEDT32.EXE 的註冊表中的一個或兩個 REG_DWORD 值:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions
和/或
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions
到 0x1 或 0x0。用户特定設置比機器設置有優先權。命令行開關比註冊表設置有優先權。