batch-file - Bat 中超时的 Taskkill

标签 batch-file command-line timeout taskkill

我想要这样的东西:-

taskkill 7z.exe after 50sec.
Execute few lines of codes without waiting for 7z.exe to be killed. 

无论执行在哪里,它都会在 50 秒后自动被杀死。

最佳答案

这就是你的意思吗?等待 50 秒后再杀死 7z.exe

Timeout 50 
taskill /f /im 7z.exe

或者你想在杀死后等待然后执行一些命令。

taskill /f /im 7z.exe
Timeout 50 
REM do commands here.

编辑:OP的新版本。

start "7z killer" cmd "/c Timeout 50 && taskkill.exe /f /im 7z.exe"
echo "do something immediately"

关于batch-file - Bat 中超时的 Taskkill,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21166364/

相关文章:

android - 如何在 adb shell 中使用 find 命令

android - 是否可以仅通过命令行构建和部署 android eclipse 项目

c# - 通过命令行编译c#代码时如何使用引用

java - Java 中 HttpURLConnection 中荒谬的连接超时

jquery - 持续运行 ajax 请求的更好方法?

windows - 有没有办法通过 Windows 命令观察文件的 'availability status'?

batch-file - 如何在 Windows 批处理脚本中检查文件的大小?

windows - 在批处理文件参数中保留 "="(相等)字符

c - fopen\fopen_s 在 c 中通过命令行编译和运行时

javascript - Node.js:长时间延迟