简体   繁体   English

Windows Task Scheduler的问题

[英]Problems with Windows Task Scheduler

I have two problems with Windows Task Manager: One, I have a Python script that sends an email notification, through gmail, at the end of the run. Windows任务管理器有两个问题:一,我有一个Python脚本,该脚本在运行结束时通过gmail发送电子邮件通知。 This works fine when I run the script itself, but when I run the script through Windows Task Scheduler, the script runs fine, but does not send an email. 当我运行脚本本身时,此方法运行良好,但是当我通过Windows Task Scheduler运行脚本时,脚本运行良好,但不发送电子邮件。 Why would this happen? 为什么会这样? Two, when running the same script through task scheduler on a remote desktop, when I am logged in, but my session is closed, firefox will not open. 二,当通过远程桌面上的任务计划程序运行相同的脚本时,当我登录但我的会话已关闭时,firefox无法打开。

Any help would be appreciated, thank you. 任何帮助,将不胜感激,谢谢。

The Task manager doesn't display any GUI for the current user. 任务管理器不显示当前用户的任何GUI。

You need to be login as system. 您需要以系统身份登录。

A similar thing happened with me ( while using PHP ) and I found out the reason that I had put a relative path to a file to be included in the code. 我(在使用PHP时)发生了类似的事情,我发现我将相对路径放置到要包含在代码中的文件的原因。

include("./lib/libfile.php");

Later when I replaced it with the absolute path it worked all right. 后来,当我用绝对路径替换它时,一切正常。

include("D://code/lib/libfile.php");

You might have a similar problem. 您可能有类似的问题。

It could be that you need to specify where it starts in. This is important if you make local references in your program. 可能是您需要指定它的开始位置。如果您在程序中进行本地引用,这一点很重要。 This would also result in your program running fine, but not doing everything it is built to do. 这也将导致您的程序运行正常,但不能完全执行其构建的工作。

Inside task scheduler, see "Actions", then edit an action. 在任务计划程序中,请参阅“操作”,然后编辑操作。 It's the parameter it says is optional. 它说的参数是可选的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM