在Windows XP中打开特定的应用程序后运行bat文件

时间:2018-08-28 06:59:37

标签: scheduled-tasks windows-xp-sp3

我想知道打开特定应用程序后如何运行bat文件吗?

例如:每当打开mspaint时,我都想运行一个bat文件。

我已经使用Task Scheduler在Windows 7和Windows 10中成功执行了此操作。但是Win Xp中提供的任务计划程序是非常基本的。

1 个答案:

答案 0 :(得分:0)

您可以使用在Windows启动时运行的另一个批处理文件。使用while循环并进行适当的睡眠以检测Paint.exe的运行时间。
那么您可以编写更多命令来执行所需的任何操作。例如,正如您所说,您可以运行另一个批处理文件...
通过调查以下主题,我找到了此解决方案:

Syntax for a single-line Bash infinite while loop
How to check if a process is running via a batch script
Batch program to to check if process exists