cmd 中后台执行命令,相当于 bash 中的&
。
start /b <your_command>
方法类似于 bash
<your_command> 1>log.txt 2>&1
在 bat 文件的开头加入如下代码:
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
之后再正常编写自己的命令即可。