windows - 任务计划程序 : Run a Java program after a Python script finishes

标签 windows powershell batch-file scheduled-tasks windows-task-scheduler

我需要每 10 分钟左右做两件事:

1) 运行 python 脚本

2) 上述脚本完成后,运行 Java 程序(JAR 文件)

为此,我正在使用 Windows 任务调度程序。我遇到了这两个链接: https://technet.microsoft.com/en-us/library/cc772785%28v=ws.10%29.aspx https://technet.microsoft.com/en-us/library/cc755618%28v=ws.10%29.aspx

但我只是不确定如何继续进行。我可以编写一些 powershell 脚本或可以解决这个问题的东西吗?非常感谢任何帮助。谢谢。

最佳答案

您可以使用 powershell 脚本来做到这一点。您可以执行一个程序,然后等待它完成任务,如下所示:

While($True)
{

Start-Process $PythonPath -Wait

Start-Process $JavaPath -Wait

Start-Sleep -m 10

}

关于windows - 任务计划程序 : Run a Java program after a Python script finishes,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33030739/

相关文章:

windows - 为什么 sqlite 1.2.3 gem 可以正确安装 MRI 而不是 JRuby?

windows - Win32_Product 的替代品?

c# - 如何判断csc.exe编译是否成功

windows - 窗口定位导致 Windows 10 上窗口周围的空间

c++ windows通过USB串行获取USB端口和集线器

windows - 让 AD 用户在 AD 的描述字段中具有特定关键字

Windows 短名称与长名称不匹配

batch-file - 在for循环中批量设置var

c++ - 程序关闭时防止用户编辑文本文件

powershell - CMD.exe与CScript/WScript