Running bat batch file in background

Scene:
When executing the bat file through the Windows timing task, the CMD window will pop up. If you do not want to be disturbed by the black box pop up, you can solve the problem by the following methods.
Solutions:
Add the following code at the beginning of the batch file:

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

 
 

Read More: