简体   繁体   English

计划任务无法运行,没有错误代码

[英]Scheduled task fails to run, no error code

We're using a scheduled task to run a simple executable every 2 minutes, it has a working directory set (no quotes round the path) but other than that most options are left as defaults. 我们正在使用计划任务每​​2分钟运行一个简单的可执行文件,它具有一个工作目录集(路径中没有引号),但除此之外,大多数选项保留为默认设置。

Running the task manually by right-clicking on it and selecting Run works just fine, however it never executes automatically. 右键单击任务并选择运行,可以手动运行任务,效果很好,但是它永远不会自动执行。 When the time comes to run the task, it just increments the "Next Run Time" field by 2 minutes and that's it. 是时候运行任务了,它只将“下一次运行时间”字段增加了2分钟,仅此而已。 The Last Run Time Field is always the last time the task was manually executed. 上次运行时间字段始终是上次手动执行任务的时间。

The Last Run Result is always 0x0. 上次运行结果始终为0x0。

I've tried setting it to run as the current user, or as an alternate user set up with administrative privileges and a stored password, but still no luck. 我尝试将其设置为以当前用户身份运行,或者以具有管理特权和存储密码的备用用户身份运行,但是仍然没有运气。

There doesn't appear to be anything immediately obvious in the system event log either to indicate the cause of the failure. 在系统事件日志中似乎没有任何立即明显的迹象表明失败的原因。

As a bit of background, this is a headless Win10 Pro machine (only ever accessed via LogMeIn) running control software for external hardware. 作为背景,这是一台运行于外部硬件的控制软件的无头Win10 Pro计算机(只能通过LogMeIn访问)。 It reboots every morning at 03:00 and since it's on an physically isolated network, automatically logs in to a user account with administrative privileges and no password. 它每天早晨03:00重新启动,并且由于它位于物理上隔离的网络上,因此会自动使用管理特权而不使用密码登录到用户帐户。

I suspect it may be a permissions issue with the insecure way the system is set up, however at this point there's little to go on. 我怀疑这可能是系统设置不安全的权限问题,但是目前为止还没有什么问题。

Any ideas? 有任何想法吗?

Thanks 谢谢

For posterity, this turned out to be an issue with the way the repetition on the scheduled task was set up. 对于后代而言,事实证明这与计划任务的重复设置方式有关。 Initially it was set up as a daily task to run every 2 minutes for 24 hours. 最初,它被设置为每日任务,每2分钟运行24小时。 Whilst this showed the correct next run time in the task scheduler window, for some reason it never executed - Bug? 尽管这在任务计划程序窗口中显示了正确的下次运行时间,但由于某种原因它从未执行-错误?

The fix was instead to set the task up as a one time event that repeats every 2 minutes indefinitely, which seems to be working properly now. 解决方法是将任务设置为一次事件,该事件每2分钟无限期重复一次,现在看来工作正常。

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

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