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