Execute Batch file in Silent mode (no cmd window) / 以無 dos 命令列視窗執行 .bat

有點繁瑣的方式,全部需要三個檔案來完成。

檔案 1: 真正的 batch file,命名為 launch.bat

@echo off
program.exe  #the batch commands you needs
exit

檔案 2: 透過 vb script (invis.vbs) 來呼叫 launch.bat 做無視窗

Set objShell = CreateObject("WScript.Shell")
strCommand = "reg_launch.bat"
objShell.Run strCommand, vbHide, TRUE

檔案 3: 用一個 batch file 來做最小化視窗執行 invis.vbs

start /min wscript.exe invis.vbs