成长值: 522
签到天数: 4799 天 [LV.Master]伴坛终老
|
发表于 2016/11/18 20:22
|
显示全部楼层
|阅读模式
| Google Chrome 53.0.2785.143 | Windows 7
如何用系统cmd命令做一个倒计时关闭一个正在运行的程序?间隔5秒等待延迟bat批处理
方法一:
@echo off
ping /n 时间(秒) 127.1>nul
taskkill -f -im 进程名.exe
比如,5秒后关闭我的世界:
@echo off
ping /n 5 127.1>nul
taskkill -f -im javaw.exe
方法二:
@echo off
taskkill /f /t /im 进程名.exe
把上面两行代码保存为kill.bat,保存在C盘根目录。
然后打开cmd,输入:
at 时间 kill.bat
注意时间24小时计时,要删除这个计划的话输入at 1 /del
输入at可以查看列表
比如:
kill.bat:
@echo off
taskkill /f /t /im javaw.exe
然后在cmd中输入:
at 22:24:00 C:\kill.bat
|
|