@echo off & title 根据时间段运行 By 依梦琴瑶
setlocal enabledelayedexpansion
call :GetNowTime
:RunPart1
::8:00~18:00
live -t 100 -p sock.txt --cid 123123
::如果需要循环运行,请把下面的exit指令删除或用注释符进行屏蔽
exit
call :GetNowTime
:RunPart2
::18:01~7:59
live -t 200 -p sock.txt --cid 123123
::如果需要循环运行,请把下面的exit指令删除或用注释符进行屏蔽
exit
call :GetNowTime
:GetNowTime
set NowTime=%time:~,8%
set NowTime=%NowTime: =0%
set NowTime=%NowTime::=%
if %NowTime% geq 080000 (
if %NowTime% leq 180000 (
goto RunPart1
) else (
goto RunPart2
)
) else (
goto RunPart2
)
goto :eof