Batch file 一段时间内的批处理循环

Batch file 一段时间内的批处理循环,batch-file,Batch File,我有一个批处理文件,它使用GOTO标签无限地运行一组命令。我想把它变成一个循环,循环运行预定的分钟数。在Windows XP及更高版本下,最好的方法是什么?在开始时解析时间变量,并添加所需的分钟数。 然后,如果达到停止时间,则需要在每个循环中进行检查 set "startTime=%time%" Split the time into Hour, minutes, seconds Add the desired minutes regarding overflows to the hour fi

我有一个批处理文件,它使用GOTO标签无限地运行一组命令。我想把它变成一个循环,循环运行预定的分钟数。在Windows XP及更高版本下,最好的方法是什么?

在开始时解析
时间
变量,并添加所需的分钟数。
然后,如果达到停止时间,则需要在每个循环中进行检查

set "startTime=%time%"
Split the time into Hour, minutes, seconds
Add the desired minutes regarding overflows to the hour field.

Begin your loop
Parse the current time
Check if Hours and minutes are reached
Else restart the loop

说起来容易做起来难。这是一个展示如何将日期/时间转换为朱利安值的网站,你可以按照杰布的建议使用它。如果可以假设分钟数小于60分钟,则可以使用更简单的kludges。了解任务的实际限制将决定这是否是一种选择。