朱纯树博客
VPS测评推荐网站
cloudacead cloudacead

用CMD批处理脚本来守护进程

网上的使用bat脚本批处理都好像有一些问题,我发一个亲测可用的!!!

测试了半天好像没啥问题!

在别人基础上改了一下!

@echo off 
::守护程序-沙箱自动化平台
rem 定义循环间隔时间和监测的服务:


set _task=v.exe
set _svr="%cd%\%_task%"
set _des=start.bat

echo.
echo ========================================
echo == 查询沙箱测试平台服务的状态, ==
echo == 每间隔10秒进行一次查询, ==
echo == 如发现其停止,则立即启动。 ==
echo == AE博客 ==
echo ========================================
echo.
echo 此脚本监测的服务是:%_task%
echo.


:checkstart
for /f "tokens=5" %%n in ('qprocess.exe ^| find "%_task%" ') do (
    if %%n==%_task% (goto checkag) else goto startsvr
)

:startsvr
echo %time%
echo ********程序开始启动********
echo 程序重新启动于 %time% ,请检查系统日志 >> restart_service.log
echo cd %_svr% > %_des%
echo start %_task% >> %_des%
echo exit >> %_des%
start %_des%
set/p=.<nul
for /L %%i in (1 1 10) do set /p a=.<nul&ping.exe /n 2 127.0.0.1>nul
echo .
echo Wscript.Sleep WScript.Arguments(0) >%tmp%\delay.vbs
cscript //b //nologo %tmp%\delay.vbs 10000
del %_des% /Q

echo ********程序启动完成********
goto checkstart

:checkag
echo %time% 程序运行正常,10秒后继续检查.. 
echo Wscript.Sleep WScript.Arguments(0) >%tmp%\delay.vbs
cscript //b //nologo %tmp%\delay.vbs 10000

goto checkstart
赞(0) 打赏
未经允许不得转载:VPS测评推荐网站 - 朱纯树博客 » 用CMD批处理脚本来守护进程

评论 15

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #0

    时刻观察牌桌的动态,确保自己永远被鱼群环绕也是很重要的能力。即使你在这张桌子已经输了两个买入也不要留恋,一旦肥鱼离开了牌桌,而桌上只剩下五个好手时,那么继续呆在这张桌子无疑是愚蠢的。不断保持对牌桌的分析,一旦发现桌子变干就立刻起身寻找更好的牌桌是你必须具备的能力。 已收录指南:1402136 双子星体育用品          以下是我们统计的前10大令人讨厌的习惯。第一部分:从第10名至第6名。明日将继续推出第5名至第1名的排名情况,敬请关注明日的德州扑克新闻报道! 假如你希望每次打德州扑克都能利润最大化,好的扑克桌选择很重要。显然如果你想从德州扑克中赢钱,应该跟不如你的对手打。所以假设A桌的对手比B桌的更有经验,聪明的玩家每次都会选择B桌的对手。为了从德州扑克中赢钱,你要不有比对手更好的策略,要不与比你差的对手打。为什么不两者兼备? https://preketown.com/community/profile/tanyawertz39109/ 荣耀战区改了称号怎么还是之前的 王者荣耀战区改了称号没变怎么办 Apple用户:点我! 谁是至尊雀神?谁是川麻之王? 相信不少小伙伴还不知道日本麻将中点棒的规则到底是什么吧!接下来就一起来和小编来看看日本麻将的详细点棒计算规则吧!日本麻将点棒怎么看:点棒(てんぼう)是表示各玩家得分的用的小长条棒,正式名称是筹码(籌馬、チ… ɨè¶þά«ςԘ¿ͻ§¶ˠ麻将之达人麻将 荣耀战区改了称号怎么还是之前的 王者荣耀战区改了称号没变怎么办 谁能推荐个麻将听牌器app 阿刚 就像腾讯欢乐麻将那样,一下叫就知道胡哪几张,会分析显示出来,谁帮忙推荐个这种app,输入进去就会显示听哪几张,我想练习哈胡牌技巧

    Uniomma5天前回复
  2. #0

    The hypothesis of efficacy for older women alone was clearly generated after the data from each study were in place and had been reviewed lasix for weight loss

    Inpuncmut1周前 (11-23)回复
  3. #0

    These observations are in line with the evidence that systemic loss of ER О± leads to lower cortical bone mass in male mice and men 34, 35 clomiphene pills

    refeInnob1周前 (11-23)回复
  4. #0

    Osteoporosis, decreased bone mineral density and bone fracture in men see PATIENT INFORMATION köp stromectol

    Voppido2周前 (11-19)回复
  5. #0

    Because of this, it becomes more concentrated with toxins including estrogens priligy price 0 eq in toluene 10 mL, compound benzophenone hydrazone 1

    crosile3周前 (11-09)回复
  6. #0

    Molecular Cloning A Laboratory Manual, Cold Spring Harbor, N nolvadex buy Vox sanguinis, 112 3, 210 218

    NofTrurry4周前 (11-05)回复
  7. #0

    No one action step provides full protection side effects of stromectol Even more important has been a parallel cultural shift Гў

    roagoff1个月前 (10-24)回复
  8. #0

    1056 NEJM199203263261302 Search in Google Scholar PubMed purchase cialis online cheap

    GonogyMob2个月前 (10-12)回复
  9. #0

    is lasix a potassium sparing diuretic Cirujanos ayudan a pacientes a obtener los tratamientos que necesitan

    gretbaf2个月前 (10-07)回复
  10. #0

    Although not explored experimentally, compensation appears plausible eg, by Mcl- 1 shown to be critical for normal thymocyte development and their stress resistance. can doxycycline cause yeast infection

    Engessy3个月前 (09-17)回复
  11. #0

    I know it will take some time to get back to how I was, but I am better than I was then. letrozole vs clomid

    crearcaps3个月前 (09-10)回复
  12. #0

    buying cialis online usa Family Resource Guide Online information updated as new information is provided Area codes are 706 and addresses are Athens unless otherwise noted Please send additions and updates to webadmin metromags

    Preepeatt3个月前 (09-07)回复
  13. #0

    Statistical heterogeneity between studies was assessed using the I 2 statistic cheapest cialis 20mg

    abnobby3个月前 (09-05)回复
  14. #0

    Buy our best medicaments for the premature ejaculation and eretile dysfunction healing with delivery in Boise buy cialis generic online cheap

    Peerden3个月前 (09-01)回复
  15. #0