tldr/pages/windows/cmd.md

37 lines
800 B
Markdown
Raw Normal View History

2018-09-26 21:01:42 +01:00
# cmd
> The Windows command interpreter.
> 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`
- Execute specific [c]ommands:
2018-09-26 21:01:42 +01:00
`cmd /c {{echo Hello world}}`
2018-09-26 21:01:42 +01:00
- Execute a specific script:
2018-09-26 21:01:42 +01:00
`cmd {{path\to\script.bat}}`
2018-09-26 21:01:42 +01:00
- Execute specific commands and then enter an interactive shell:
2018-09-26 21:01:42 +01: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
- Start an interactive shell session with used [u]nicode encoding:
2018-09-26 21:01:42 +01:00
`cmd /u`