gpt4 book ai didi

batch-file - 如何在 Windows 7 下为进程设置超时?

转载 作者:行者123 更新时间:2023-12-03 10:10:36 24 4
gpt4 key购买 nike

我想用 Windows 批处理文件启动一个程序。但是程序应该在某个超时值后停止。例如:运行程序 60 秒,60 秒后停止。

在 Linux 下,有这个不错的 timeout命令做我想做的事。 Windows 还有一个 timeout命令,但它只是暂停命令,延迟其执行。在 Windows 下还有其他东西可以这样做吗?

设置:Windows 7、64 位、专业版

最佳答案

start yourprogram.exe
timeout /t 60
taskkill /im yourprogram.exe /f

关于batch-file - 如何在 Windows 7 下为进程设置超时?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13515254/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com