首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在哪里可以找到Windows任务计划程序退出代码列表?

在哪里可以找到Windows任务计划程序退出代码列表?
EN

Stack Overflow用户
提问于 2014-03-19 01:14:07
回答 4查看 51.5K关注 0票数 8

我所发现的关于Windows 结果的全部内容都是关于几个代码的简短细节。

有人知道完整的名单吗?

例如,我无法找到关于错误代码0xFF的任何信息。

编辑:例如,如果我添加此任务(用于测试名为“Notifu”的命令行程序):

代码语言:javascript
运行
复制
schtasks /create /tn "NotifuTest" /tr "d:\Temporal\Notifu\notifu64.exe /m 'Test'" /sc minute /mo 1 /sd 10/10/2010 /ru "SYSTEM"

同一命令已通过命令行进行验证。

这是结果(对不起,我的Windows是西班牙语的);请注意0xFF (程序似乎正在执行,但没有结果:

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2014-03-19 10:55:54

进程退出代码是特定于进程的。按照惯例,零的值表示成功。唯一的保留值是STILL_ACTIVE,它的值为259 (0x103)。当进程仍然处于活动状态时,由GetExitCodeProcess返回。要理解这些值意味着什么,您必须查阅有关过程的文档。

票数 7
EN

Stack Overflow用户

发布于 2015-01-14 10:03:11

您可以在这里找到一个列表:http://msdn.microsoft.com/en-gb/library/windows/desktop/aa383604(v=vs.85).aspx

但是,它还没有完成,因为我遇到了这个结果,例如: 0x7FFBD3FA

票数 10
EN

Stack Overflow用户

发布于 2022-04-26 14:48:14

我使用维基百科上的列表来创建这个C#方法,用于将任务调度程序错误代码映射到消息,用于那些懒散的消息:-)

代码语言:javascript
运行
复制
private static string? MessageFromTaskSchedulerErrorCode(uint errorCode)
{
    return errorCode switch
    {
        0x0 => "The operation completed successfully.",
        0x1 => "Incorrect function called or unknown function called.",
        0x2 => "File not found.",
        0xa => "The environment is incorrect.",
        0x00041300 => "Task is ready to run at its next scheduled time.",
        0x00041301 => "The task is currently running.",
        0x00041302 => "The task has been disabled.",
        0x00041303 => "The task has not yet run.",
        0x00041304 => "There are no more runs scheduled for this task.",
        0x00041305 => "One or more of the properties that are needed to run this task have not been set.",
        0x00041306 => "The last run of the task was terminated by the user.",
        0x00041307 => "Either the task has no triggers or the existing triggers are disabled or not set.",
        0x00041308 => "Event triggers do not have set run times.",
        0x80010002 => "Call was canceled by the message filter",
        0x80041309 => "A task's trigger is not found.",
        0x8004130A => "One or more of the properties required to run this task have not been set.",
        0x8004130B => "There is no running instance of the task.",
        0x8004130C => "The Task Scheduler service is not installed on this computer.",
        0x8004130D => "The task object could not be opened.",
        0x8004130E => "The object is either an invalid task object or is not a task object.",
        0x8004130F => "No account information could be found in the Task Scheduler security database for the task indicated.",
        0x80041310 => "Unable to establish existence of the account specified.",
        0x80041311 => "Corruption was detected in the Task Scheduler security database",
        0x80041312 => "Task Scheduler security services are available only on Windows NT.",
        0x80041313 => "The task object version is either unsupported or invalid.",
        0x80041314 => "The task has been configured with an unsupported combination of account settings and run time options.",
        0x80041315 => "The Task Scheduler Service is not running.",
        0x80041316 => "The task XML contains an unexpected node.",
        0x80041317 => "The task XML contains an element or attribute from an unexpected namespace.",
        0x80041318 => "The task XML contains a value which is incorrectly formatted or out of range.",
        0x80041319 => "The task XML is missing a required element or attribute.",
        0x8004131A => "The task XML is malformed.",
        0x0004131B => "The task is registered, but not all specified triggers will start the task.",
        0x0004131C => "The task is registered, but may fail to start.Batch logon privilege needs to be enabled for the task principal.",
        0x8004131D => "The task XML contains too many nodes of the same type.",
        0x8004131E => "The task cannot be started after the trigger end boundary.",
        0x8004131F => "An instance of this task is already running.",
        0x80041320 => "The task will not run because the user is not logged on.",
        0x80041321 => "The task image is corrupt or has been tampered with.",
        0x80041322 => "The Task Scheduler service is not available.",
        0x80041323 => "The Task Scheduler service is too busy to handle your request. Please try again later.",
        0x80041324 => "The Task Scheduler service attempted to run the task, but the task did not run due to one of the constraints in the task definition.",
        0x00041325 => "The Task Scheduler service has asked the task to run.",
        0x80041326 => "The task is disabled.",
        0x80041327 => "The task has properties that are not compatible with earlier versions of Windows.",
        0x80041328 => "The task settings do not allow the task to start on demand.",
        0xC000013A => "The application terminated as a result of a CTRL+C.",
        0xC0000142 => "The application failed to initialize properly.",
        _ => null
    };
}

有些人看到了MSDN文档中没有出现的错误。我不知道是不是他们运行的应用程序(因为你也可以从它得到返回代码,假设它真的运行),但我没有什么其他的办法。

此外,还可以使用Marshal.GetExceptionForHR获得映射到友好消息的可能的HResult异常,但除此之外,我不知道还能做什么。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22494333

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档