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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22494333/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 11:28:15  来源:igfitidea点击:

Where can I find the Windows Task Scheduler exit codes list?

windowsscheduled-tasksexit-codewindows-task-scheduler

提问by Sopalajo de Arrierez

All I have found about the Windows Task Schedulerresults are short details about just a few codes.
Does anybody knows about a complete list?
For example, I have not been able to locate anything about the error code 0xFF.

我发现的有关Windows 任务计划程序结果的所有信息都是关于几个代码的简短详细信息。
有人知道完整列表吗?
例如,我无法找到有关错误代码0xFF 的任何信息。

EDIT:For example, if I add this task (for testing a command line program called "Notifu"):

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

schtasks /create /tn "NotifuTest" /tr "d:\Temporal\Notifu\notifu64.exe /m 'Test'" /sc minute /mo 1 /sd 10/10/2010 /ru "SYSTEM"

The same command has been verified working by command-line.
This is the result (sorry, my Windows is in spanish); note the 0xFF(the program seems to be executing, but with no results:

相同的命令已通过命令行验证工作。
这是结果(抱歉,我的 Windows 是西班牙语);注意0xFF(程序似乎正在执行,但没有结果:

enter image description here

在此处输入图片说明

回答by Fab

You can find a list here: http://msdn.microsoft.com/en-gb/library/windows/desktop/aa383604(v=vs.85).aspx

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

However it is not complete as I have encountered this result for exemple: 0x7FFBD3FA

但是它并不完整,因为我遇到了这个结果,例如:0x7FFBD3FA

回答by David Heffernan

Process exit codes are process specific. By convention a value of zero indicates success. The only reserved value is STILL_ACTIVEwhich has value 259. That is returned by GetExitCodeProcesswhen the process is still active. To understand what the values mean you will have to consult the documentation of the process in question.

进程退出代码是特定于进程的。按照惯例,零值表示成功。唯一保留的值是STILL_ACTIVE其值为 259。GetExitCodeProcess当进程仍处于活动状态时返回该值。要了解这些值的含义,您必须查阅相关流程的文档。

回答by BobHy

As was mentioned above, the exit codes reported by Task Scheduler depend on the program you invoke in the job.

如上所述,Task Scheduler 报告的退出代码取决于您在作业中调用的程序。

Specifically for CMD.EXE (used when you run a .CMD or .BAT file), exit 0xFF means syntax error in the batch file.

特别是对于 CMD.EXE(在运行 .CMD 或 .BAT 文件时使用),exit 0xFF 表示批处理文件中的语法错误。

CMD.EXE in Windows has been a Microsoft product for 25+ years and there is stillno documentation of its exit codes. That's unprofessional.

Windows 中的 CMD.EXE 已成为 Microsoft 产品 25 年以上,但仍然没有其退出代码的文档。那是不专业的。