【问题标题】:create batch file for checking XAMPP Control Panel创建用于检查 XAMPP 控制面板的批处理文件
【发布时间】:2015-09-18 13:49:16
【问题描述】:

我目前正在我的服务器上运行 XAMPP,我想创建一个批处理文件,该文件基本上每 20 秒检查一次 XAMPP 是否一直在运行。如果它运行,则检查循环应在接下来的 20 秒内重新启动,依此类推。但是如果它检测到 XAMPP 没有运行它应该直接启动程序。

【问题讨论】:

标签: batch-file xampp


【解决方案1】:

试试这样:

@echo off
Set "MyProcess=Notepad.exe"

:start
tasklist | find /i "%MyProcess%">nul && goto:wait || start %MyProcess%
goto:start

:wait
ping localhost -n 20 >nul
goto:start

只需将 Notepad.exe 替换为您的程序名称

【讨论】:

    猜你喜欢
    • 2019-06-03
    • 1970-01-01
    • 1970-01-01
    • 2017-03-01
    • 2012-10-24
    • 1970-01-01
    • 1970-01-01
    • 2012-02-11
    • 2013-08-31
    相关资源
    最近更新 更多