第一種方法
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