2019-03-10 14:43:32 +00:00
|
|
|
|
# doskey
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
> 管理宏,Windows 命令和命令行。
|
2021-10-01 19:28:01 +01:00
|
|
|
|
> 更多信息:<https://docs.microsoft.com/windows-server/administration/windows-commands/doskey>.
|
2019-03-10 14:43:32 +00:00
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 列出可用的宏:
|
2019-03-10 14:43:32 +00:00
|
|
|
|
|
|
|
|
|
`doskey /macros`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 创建一个新的宏:
|
2019-03-10 14:43:32 +00:00
|
|
|
|
|
|
|
|
|
`doskey {{宏的名称}} = "{{命令}}"`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 为指定可执行文件创建新的宏:
|
2019-03-10 14:43:32 +00:00
|
|
|
|
|
|
|
|
|
`doskey /exename={{可执行文件名}} {{宏的名称}} = "{{命令}}"`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 删除一个宏:
|
2019-03-10 14:43:32 +00:00
|
|
|
|
|
|
|
|
|
`doskey {{宏的名称}} =`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 列出所有储存在内存中的命令:
|
2019-03-10 14:43:32 +00:00
|
|
|
|
|
|
|
|
|
`doskey /history`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 将宏保存到文件以便于移植:
|
2019-03-10 14:43:32 +00:00
|
|
|
|
|
|
|
|
|
`doskey /macros > {{保存宏的文件名}}`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 从文件中加载宏:
|
2019-03-10 14:43:32 +00:00
|
|
|
|
|
|
|
|
|
`doskey /macrofile = {{保存宏的文件名}}`
|