gpt4 book ai didi

Windows 批处理 : analogue for `timeout` command

转载 作者:可可西里 更新时间:2023-11-01 14:45:18 31 4
gpt4 key购买 nike

我正在尝试了解如何在 Windows 批处理文件中 限制程序执行时间。是否有类似 Unix timeout 命令的东西?请指教。

最佳答案

要限制程序必须运行的时间,您可以这样做

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

这会启动 yourprogram.exe,等待 10 秒,然后终止程序。

关于Windows 批处理 : analogue for `timeout` command,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12394338/

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