第一种方法
bat批处理文件头加入
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
第二种方法
新建vbs脚本
CreateObject("WScript.Shell").Run "cmd /c D:/your.bat",0
bat批处理文件头加入
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
新建vbs脚本
CreateObject("WScript.Shell").Run "cmd /c D:/your.bat",0