让bat批处理后台运行,不显示cmd窗口

在你写的批处理文件,开头加上以下三行代码即可

if "%1"=="hide" goto CmdBegin
start mshta vbscript:createobject("wscript.shell").run("""%~0"" hide",0)(window.close)&&exit
:CmdBegin
————————————————

或者

%1 mshta vbscript:CreateObject("WScript.Shell").Run("%~s0 ::",0,FALSE)(window.close)&&exit

猜你喜欢

转载自blog.csdn.net/lp_cq242/article/details/102625665
今日推荐