蝙蝠超时任务技能 [英] Taskkill with timeout in bat

查看:211
本文介绍了蝙蝠超时任务技能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要这样的东西:-

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

无论执行在哪里,它都会在50秒后自动终止.

It will automatically be killed after 50sec, wherever the execution is going on.

推荐答案

这是您的意思吗?等待50秒,然后杀死7z.exe

Is this what you mean ? Waiting 50 seconds before killing 7z.exe

Timeout 50 
taskill /f /im 7z.exe

或者您想在杀死之后等待,然后执行一些命令.

or you want to wait after killing then do some commands.

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"

这篇关于蝙蝠超时任务技能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆