网站首页  词典首页

请输入您要查询的函数:

 

术语 netschedulejobadd
释义 NetScheduleJobAdd
语法:
C++
NET_API_STATUS NetScheduleJobAdd(
__in_opt LPCWSTR Servername,
__in LPBYTE Buffer,
__out LPDWORD JobId
);
NetScheduleJobAdd功能
该NetScheduleJobAdd函数提交一份工作运行一个指定的未来时间和日期。此函数需要服务的时间就已经在该作业提交计算机上启动。
参数
服务器名称[中,可选]
一个常量字符串,它指定的DNS或NetBIOS的远程服务器上的功能是执行名称的指针。如果该参数为NULL,则使用本地计算机。
缓冲区 [in]
对一个AT_INFO结构的指针,说明这项工作提交。如需使用不同的调度工作性质工作的资料,请参阅下面的备注部分和网络管理功能的缓冲器。
的JobID [out]
一个指针,接收到的新提交的作业的作业标识符。这个项目是有效的只有当函数返回成功。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值是一个系统错误代码。对于一个错误代码的列表,请参见系统错误代码。
备注
通常只有会员的本地管理员组的工作日程安排下被添加能够成功地执行这一功能的电脑。如果服务器名称的字符串传递指向的服务器名参数是一个远程服务器,然后本地Administrators组的成员在远程服务器可以成功地执行这一职能。
如果以下注册表值最低有效位设置(例如,0x00000001),然后用户属于Server Operators组也可以成功地执行这一功能。
HKLM \\系统\\ CurrentControlSet \\控制\\唾液酸\\ SubmitControl
以下是如何安排工作,使用由NetScheduleJobAdd功能支持不同的属性的例子。
要安排一份工作,执行一次:
设置AT_INFO结构DaysOfMonth成员为零。
设置AT_INFO结构DaysOfWeek成员为零。
设置AT_INFO结构,工作时间应执行JobTime成员。
这项工作在由AT_INFO结构JobTime成员中指定的时间执行所指向的缓冲区参数。工作完成后执行,它将被删除。
要安排和删除一份工作,多次执行:
设置在AT_INFO结构或DaysOfMonth成员适当的位
设置在AT_INFO结构DaysOfWeek成员的相应位。
设置AT_INFO结构,工作时间应执行JobTime成员。
注意您不必设置既DaysOfMonth及AT_INFO结构的DaysOfWeek成员。
这项工作在由AT_INFO结构JobTime成员中指定的时间执行所指向的缓冲区参数,一次在AT_INFO结构DaysOfMonth或DaysOfWeek成员确定每一天。每个职位后执行,相应的位被清除。当最后一位被清除,工作被删除。
要安排一份工作,定期执行:
设置在AT_INFO结构或DaysOfMonth成员适当的位
设置在AT_INFO结构DaysOfWeek成员的相应位。
设置AT_INFO结构,工作时间应执行JobTime成员。
设置在AT_INFO成员结构的标志旗JOB_RUN_PERIODICALLY作业提交。
注意您不必设置既DaysOfMonth及AT_INFO结构的DaysOfWeek成员。
这项工作将执行定期在由AT_INFO结构JobTime成员中指定的时间,所指向的缓冲区参数对在AT_INFO结构DaysOfMonth或DaysOfWeek成员设置每天。这项工作将不会被删除的重复处决。唯一的方法删除的工作是由显式调用NetScheduleJobDel功能。
见一个DaysOfWeek,DaysOfMonth和工作财产位掩码描述AT_INFO结构。
在Windows 2000中,早前在服务和任务计划合并。任务计划程序服务只精确到分钟。因此,NetScheduleJobAdd功能只使用小时,在AT_INFO结构JobTime成员中指定分钟时,工作按计划运行。
与Windows Vista,对任务计划开始的精度提高到第二位。因此,NetScheduleJobAdd功能只使用小时,分钟和在AT_INFO结构JobTime成员中指定秒时,工作按计划运行。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmat.h(包括Lmat.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
网络管理概述
网络管理功能
附表功能
AT_INFO
NetScheduleJobDel
NetScheduleJobEnum
NetScheduleJobGetInfo
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月13日
==英文原文==NetScheduleJobAdd Function
The NetScheduleJobAdd function submits a job to run at a specified future time and date. This function requires that the schedule service be started on the computer to which the job is submitted.
Syntax
C++
NET_API_STATUS NetScheduleJobAdd(
__in_opt LPCWSTR Servername,
__in LPBYTE Buffer,
__out LPDWORD JobId
);
Parameters
Servername [in, optional]
A pointer to a constant string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used.
Buffer [in]
A pointer to an AT_INFO structure describing the job to submit. For more information about scheduling jobs using different job properties, see the following Remarks section and Network Management Function Buffers .
JobId [out]
A pointer that receives a job identifier for the newly submitted job. This entry is valid only if the function returns successfully.
Return Value
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value is a system error code. For a list of error codes, see System Error Codes .
Remarks
Normally only members of the local Administrators group on the computer where the schedule job is being added can successfully execute this function. If the server name passed in the string pointed to by the Servername parameter is a remote server, then only members of the local Administrators group on the remote server can successfully execute this function.
If the following registry value has the least significant bit set (for example, 0x00000001), then users belonging to the Server Operators group can also successfully execute this function.
HKLM\\System\\CurrentControlSet\\Control\\Lsa\\SubmitControl
The following are examples of how to schedule jobs using different properties supported by the NetScheduleJobAdd function.
To schedule a job that executes once:
Set the DaysOfMonth member of the AT_INFO structure to zero.
Set the DaysOfWeek member of the AT_INFO structure to zero.
Set the JobTime member of the AT_INFO structure to the time the job should execute.
The job executes at the time specified by the JobTime member of the AT_INFO structure pointed to by the Buffer parameter. After the job executes, it is deleted.
To schedule and delete a job that executes multiple times:
Set the appropriate bits in the DaysOfMonth member of the AT_INFO structure or
Set the appropriate bits in the DaysOfWeek member of the AT_INFO structure.
Set the JobTime member of the AT_INFO structure to the time the job should execute.
Note You do not need to set both the DaysOfMonth and the DaysOfWeek members of the AT_INFO structure.
The job executes at the time specified by the JobTime member of the AT_INFO structure pointed to by the Buffer parameter, once for each day set in the DaysOfMonth or DaysOfWeek members of the AT_INFO structure. After each job executes, the corresponding bit is cleared. When the last bit is cleared, the job is deleted.
To schedule a job that executes periodically:
Set the appropriate bits in the DaysOfMonth member of the AT_INFO structure or
Set the appropriate bits in the DaysOfWeek member of the AT_INFO structure.
Set the JobTime member of the AT_INFO structure to the time the job should execute.
Set the job submission flag JOB_RUN_PERIODICALLY in the Flags member of the AT_INFO structure.
Note You do not need to set both the DaysOfMonth and the DaysOfWeek members of the AT_INFO structure.
The job will execute periodically, at the time specified by the JobTime member of the AT_INFO structure pointed to by the Buffer parameter, on each day set in the DaysOfMonth or DaysOfWeek member of the AT_INFO structure. The job will not be deleted as a result of the repeated executions. The only way to delete the job is by an explicit call to the NetScheduleJobDel function.
See the AT_INFO structure for a description of the DaysOfWeek, DaysOfMonth, and job property bitmasks.
On Windows 2000, the earlier AT service and the Task Scheduler were combined. The Task Scheduler service was only accurate to the minute. Therefore, the NetScheduleJobAdd function only uses hours and minutes specified in the JobTime member of the AT_INFO structure when a job is scheduled to run.
Starting with Windows Vista, the precision for the Task Scheduler was increased to the second. Therefore, the NetScheduleJobAdd function uses only the hours, minutes, and seconds specified in the JobTime member of the AT_INFO structure when a job is scheduled to run.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderLmat.h (include Lmat.h)
LibraryNetapi32.lib
DLLNetapi32.dll
See Also
Network Management Overview
Network Management Functions
Schedule Functions
AT_INFO
NetScheduleJobDel
NetScheduleJobEnum
NetScheduleJobGetInfo
Send comments about this topic to Microsoft
Build date: 8/13/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa370614(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:22:57