批处理文件 - 重启程序会每隔20分钟后 [英] Batch file - restart program after every 20 minutes

查看:230
本文介绍了批处理文件 - 重启程序会每隔20分钟后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个启动程序,20分钟后会关闭程序并重新启动批处理文件。

我知道一个批处理文件的唯一的事情就是如何启动一个程序:

 关闭@echo
启动[应用ADRESS]


解决方案

这个作品:

 关闭@echo //关闭屏幕短信
:所谓的循环,循环//设置标志返回
启动Wicked_Article_CreatorC:\\妖兽文章造物主\\妖兽文章Creator.exe//启动方案,标题和程序路径
超时/ T 1200 GT;空//等待20分钟
TASKKILL / F / IM映像名称> NUL //图片的名称,例如WickedArticleCreator.exe,可以通过任务经理&gt找到;流程标签>映像名称列(查找程序)
超时/吨,7个空//等待7秒钟,给你prgram时间才能完全关闭 - (可选)
转到循环//返回循环标记

I want to create batch file which starts a program and after 20 minutes will close the program and start it again.

The only thing I know about a batch file is how to start a program:

@echo off
Start [adress of application]

解决方案

This works:

@echo off                           //Turn off screen text messages
:loop                               //Set marker called loop, to return to
start "Wicked_Article_Creator" "C:\Wicked Article Creator\Wicked Article Creator.exe"  //Start program, with title and program path 
timeout /t 1200 >null               //Wait 20 minutes
taskkill /f /im "Image Name" >nul   //Image name, e.g. WickedArticleCreator.exe, can be found via Task Manager > Processes Tab > Image Name column (look for your program)
timeout /t 7 >null                  //Wait 7 seconds to give your prgram time to close fully - (optional)
goto loop                           //Return to loop marker

这篇关于批处理文件 - 重启程序会每隔20分钟后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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