我有一个小的实用程序脚本clear.bat,它在我的源上做一些内务处理工作.
它是一个.bat文件,因此我可以在Windows资源管理器中轻松双击它.
有时,我发现从我的Git bash执行它更方便(msysgit,如果这很重要).
为此,我打字
cmd
clear.bat
exit
Run Code Online (Sandbox Code Playgroud)
cmd把我的Git bash变成一个普通的cmd窗口,我可以轻松地执行我的批处理.当我输入时exit,cmd环境终止,我回到我的Git bash中.
这可以通过更简单的方式实现吗?
cmd /C clean.bat自从文档说出来以后我就试过了
Syntax
CMD [charset] [options]
CMD [charset] [options] [/c Command]
CMD [charset] [options] [/k Command]
Options
/C Run Command and then terminate
/K Run Command and then return to the CMD prompt.
This is useful for testing, to examine variables
Run Code Online (Sandbox Code Playgroud)
编辑:
刚注意到帖子坏了.
我想是执行clean.bat从GIT中的bash内,而无需键入三个命令上述(cmd,clear.bat,exit).我只想 …