任务计划程序工作项未运行 [英] Task Scheduler WorkItem Not Running

查看:66
本文介绍了任务计划程序工作项未运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常具体的问题需要解决.主要问题是我不完全知道如何在谷歌上正确搜索我的问题的残余.因此,我来​​到 StackOverflow 寻求建议,希望有人能帮助我.

I have a very specific problem that I need fixing. The major issue is that I don't exactly know how to properly search the remnants of my problem on google. Therefore I am coming to StackOverflow for advice in hopes that someone will assist me.

总结

因此,我正在编写一个应用程序,该应用程序将符合我所创办的公司的 PCI 标准.该应用程序涉及 IPC(进程间通信)和两个监视主应用程序状态的看门狗"应用程序.这些看门狗"应用程序之一是更新程序(向服务器发送 HTTP 请求以查找应用程序的更新).

So I am writing an application which is to be PCI-compliant for the company which I am starting. The application involves IPC (Inter-process communication) and two "watch-dog" apps which monitor the status of the main application. One of these "watch-dog" applications is an updater (sends an HTTP Request to the server looking for updates of the application).

所以!如果应用程序是最新的,我用来检查服务器的方法是使用 WinInet 库和 InternetOpen() 发送请求.然后读取页面的响应并使用 GetCookie() 将响应存储在缓冲区中.然后它应该相应地解析响应.

So! This method which I am using to check the server if the application is up-to-date is using the WinInet library and InternetOpen() to send the request. Then read the response of the page and use GetCookie() to store the response in a buffer. It shall then parse the response accordingly.

如果响应说我的应用程序的当前版本低于服务器上的版本.然后它会告诉客户(用户)他们的应用程序已过期,并询问他们是否要更新软件.如果他们选择更新软件,它将从 Internet 执行下载并执行,并在用户的 PC 上启动更新安装程序.

If the response says that the current version of my application is less than the version located on the server. It will then tell the customer (user) that their application is out of date, and ask them whether or not they want to update the software. If they choose to update the software, it will perform a Download And Execute from the internet and launch the update-installer on the user's PC.

问题

不幸的是,当涉及到未经授权"的应用程序向传出 url 发送 HTTP 请求时,Windows 非常安全",更不用说从服务器下载某些内容然后在用户 PC 上执行它了.

Unfortunately, windows is very "secure" when it comes to having an "unauthorized" application send an HTTP Request to an outgoing url, let alone download something from the server then execute it on the users PC.

我对这个问题的结论是将看门狗程序添加到任务计划程序中.这样,在主应用程序运行后,它将生成看门狗程序并检查它们是否以 NTAUTHORITY 权限(由任务计划程序授予)运行.

My conclusion to this issue was to add the watch-dog programs to the Task Scheduler. That way after the main application is run, it will spawn the watch-dog programs and check if they are running with NTAUTHORITY privileges (which are granted by the Task Scheduler).

在执行代码以创建任务并将其指向看门狗程序的位置、命名、编写描述和所有内容之后.我执行了程序.虽然这里是真正的问题,但它没有错误地运行:

After implementing the code to create the task and point it to the location of the watch-dog programs, naming it, writing a description and everything. I executed the program. It ran without errors though here the REAL PROBLEM:

1) 程序执行

2) 生成看门狗程序

3) 看门狗程序检查新版本

3) Watchdog program checks for new version

4) 找到版本

5) 安装程序已下载,执行...但是

5) Installer is downloaded, execute ... but

6) 安装程序没有出现在屏幕上!

6) The installer does not appear on the screen!

当我运行Process Hacker"应用程序来监控所有进程操作时.我可以看到新的安装程序是下载 &执行.它像看门狗程序一样作为 NTAUTHORITY/SYSTEM 运行,但它没有出现在系统上.

When I run my 'Process Hacker' application to monitor all process actions. I can see that the new installer is download & executed. It is running as NTAUTHORITY/SYSTEM just like the watch-dog programs but it doesn't appear on the system.

当我在没有 NTAUTHORITY/SYSTEM 状态和普通用户状态的情况下以我的用户身份运行应用程序而不将其添加到任务计划程序时.它执行(显然因为我已经以管理员身份运行) - 一切正常.但是在将它添加到任务计划程序并让它以 SYSTEM 级别权限运行之后.该窗口不会以视觉方式出现在屏幕上.这是为什么?

When I run the application without adding it to the Task Scheduler as my user without NTAUTHORITY/SYSTEM status and just regular user status. It executes (obviously since I am already running as administrator) -- everything works fine. But after adding it to Task Scheduler and having it run with SYSTEM level privileges. The window doesn't appear on the screen visually. Why's that?

如果有人能够帮助我解决这个问题,我将不胜感激.谢谢!

I would greatly appreciate anyone that is able to assist me with this problem. Thank-you!

编辑 1

谁能帮我理解这个用户是如何在注册表中应用他的修复的?通过阅读问题,我可以在一定程度上理解他和我有同样的问题.

Can anyone help me understand how this user applied his fix in the registry? By reading the problem I can somewhat interpret that he had the same issue as me.

应用不可见如果在没有任何用户登录的情况下从任务计划程序启动

无论如何,我正在尝试使用 Gisley 给我的建议以交互模式运行应用程序.可能会尝试尝试一下.仍在寻找更多答案,但在此期间,我将继续努力.

In any case, I am trying to use the advice that Gisley gave me to run the application in Interactive Mode. Possibly going to try to give that a try. Still looking for more answers but I am going to be working no this none-the-less in the meantime.

编辑 2

我尝试设置 INTERACTIVE FLAG,但不幸的是它没有效果.

I tried setting the INTERACTIVE FLAG and it had no effect unfortunately.

请允许我强调我的问题:

Allow me to just emphasize my problem:

例如,我编写了一个带有消息框的程序并将其放入循环中.

For example I write a program which has message boxes and put it in a loop.

为了

留言框

获取当前pid

任务调度器中的make进程

make process in the task scheduler

使用 NTAUTHORITY/SYSTEM 生成新进程作为任务调度程序

spawn new process as the task scheduler proc with NTAUTHORITY/SYSTEM

杀死最后一个进程pid

kill last proc pid

结束

然后当我执行它时:

我收到了消息框.然后在使用 NTAUTHORITY/SYSTEM 打开新进程后,消息框不再出现.

I get the message box. Then after new process opens with NTAUTHORITY/SYSTEM the message box does not appear anymore.

如果我打开一个计算器也是一样.

Same for if I open a calculator for example.

System("cmd.exe start/c calc.exe")

System("cmd.exe start /c calc.exe")

程序运行...打开计算器程序获得 NTAUTHORITY/SYSTEM 状态在下一个循环中执行 calc.exe我在我的任务管理器中看到它,但它没有出现在屏幕上

Program runs... opens calculator Program gets NTAUTHORITY/SYSTEM status ON the next loop it executes the calc.exe I see it in my task manager but it doesnt appear on the screen

我希望以上内容有助于强调我的问题的核心.我没有看到由具有 NTAUTHORITY/SYSTEM 权限的任务调度程序进程 ID 打开的进程...我在屏幕上没有看到它执行的进程,尽管我在任务管理器中看到它们 |进程黑客,他们也以 NTAUTHORITY/SYSTEM 权限运行.

I hope the above helped emphasize the core of my issue. I dont see the processes opened by the task scheduler process id with NTAUTHORITY/SYSTEM rights... I dont see the procs executed by it on my screen, though I see them in the task manager | process hacker and they are running with NTAUTHORITY/SYSTEM privileges too.

推荐答案

摸不着头脑 - 尝试以交互模式运行任务,但您需要有用户登录.

A shot in the dark - try running the task in interactive mode, but you'll need to have a user logged on.

https://superuser.com/questions/616206/run-interactive-task-even-if-user-is-not-logged-on-windows

或者或另外,将参数传递给安装程序,使其静默安装.

Alternatively, or additionally, pass parameters to the installer so that it installs silently.

MSI 包的静默安装

这篇关于任务计划程序工作项未运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆