php - Windows Bat 检查 php 脚本是否运行

标签 php windows batch-file

我正在使用 bat 在 win2003 调度程序上运行 php。有没有办法检查进程并查看文件是否仍在运行。

最佳答案

你的批处理文件怎么样:(伪代码,已经有一段时间了)

:makerandom
make som random var, microtime, whatever, we call it %x%
check if file exist, if it does, goto makerandom
call the script with %x% as argument
:check
if file exist %x% goto check
:done

在 php 脚本中:

create the file specified by the argument
... script here ...
delete the file

关于php - Windows Bat 检查 php 脚本是否运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5944308/

相关文章:

windows - 如何防止使用命令 echo 在文本输出中显示 echo 命令行本身?

php - Flash AS2 不会从 mySQL 数据库加载数据! (使用 PhP、AS2 和 MySQL)

c - 如何插值 HSV 颜色?

windows - 如何在 XP 上设置 wirble 着色

c# - 替换MySQL数据库中的特定值

windows - 从 Visual Studio 2013 命令提示符追加到 INCLUDE 环境变量

batch-file - 如何在内部for循环之外使用批处理文件变量

php - cURL 请求(使用 Stripe API)会减慢页面加载时间 - 发出请求的最佳方式?

php - 在 Magento 博客上添加搜索字段

php - 我应该如何访问在 theme_preprocess 中设置的变量?