Windows batch: analogue for `timeout` command

前端 未结 4 1588
不思量自难忘°
不思量自难忘° 2021-01-06 14:26

I\'m trying to find out how to limit a program execution time within a Windows batch file. Is there something like Unix timeout command? Please advise.

4条回答
  •  轮回少年
    2021-01-06 14:43

    I don't think there is a timeout command. However, you can start executing a task in the background and sleep (using ping) for the timeout duration then kill the task.

提交回复
热议问题