2018-09-26 21:01:42 +01:00
|
|
|
# cmd
|
|
|
|
|
|
|
|
> The Windows command interpreter.
|
2022-10-04 16:06:23 +01:00
|
|
|
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/cmd>.
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2021-11-22 17:37:32 +00:00
|
|
|
- Start an interactive shell session:
|
2018-09-26 21:01:42 +01:00
|
|
|
|
|
|
|
`cmd`
|
|
|
|
|
2023-02-05 14:51:25 +00:00
|
|
|
- Execute specific [c]ommands:
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2023-02-05 14:51:25 +00:00
|
|
|
`cmd /c {{echo Hello world}}`
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2023-02-05 14:51:25 +00:00
|
|
|
- Execute a specific script:
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`cmd {{path\to\script.bat}}`
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2023-02-05 14:51:25 +00:00
|
|
|
- Execute specific commands and then enter an interactive shell:
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2023-02-05 14:51:25 +00:00
|
|
|
`cmd /k {{echo Hello world}}`
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2021-11-22 17:37:32 +00:00
|
|
|
- Start an interactive shell session where `echo` is disabled in command output:
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2021-11-22 17:37:32 +00:00
|
|
|
`cmd /q`
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2021-11-22 17:37:32 +00:00
|
|
|
- Start an interactive shell session with delayed [v]ariable expansion enabled or disabled:
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2021-11-22 17:37:32 +00:00
|
|
|
`cmd /v:{{on|off}}`
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2021-11-22 17:37:32 +00:00
|
|
|
- Start an interactive shell session with command [e]xtensions enabled or disabled:
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2021-11-22 17:37:32 +00:00
|
|
|
`cmd /e:{{on|off}}`
|
2018-09-26 21:01:42 +01:00
|
|
|
|
2023-02-05 14:51:25 +00:00
|
|
|
- Start an interactive shell session with used [u]nicode encoding:
|
2018-09-26 21:01:42 +01:00
|
|
|
|
|
|
|
`cmd /u`
|