查找计划任务向导任务信息的脚本 [英] Script for finding scheduled task wizards task info

查看:60
本文介绍了查找计划任务向导任务信息的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有一个命令可以查找计算机的计划任务,但是我想获取有关计划任务本身的更多信息.我想知道计划的任务将在何时何地执行,以及计划任务的名称和区域.有什么想法吗?

I know there is a command for finding the scheduled tasks of a computer but I want to get more information on the scheduled tasks themselves. I want to know when and what time a scheduled task will be performed ALONG with the name and area of the scheduled task. Any ideas?

推荐答案

Set TS = CreateObject("Schedule.Service")
TS.Connect("Serenity")

Set rootFolder = TS.GetFolder("\")

Set tasks = rootFolder.GetTasks(0)

If tasks.Count = 0 Then 
    Wscript.Echo "No tasks are registered."
Else
    WScript.Echo "Number of tasks registered: " & tasks.Count

    For Each Task In Tasks
    A=Task.Name
    A = A & " " & Task.NextRunTime
    wscript.echo A
    Next
End If

在帮助中,其中一些是其中包含其他信息的对象.

From Help, some of these are objects with other info in them.

RegisteredTask

RegisteredTask

脚本对象,提供用于立即运行任务,获取任务的任何正在运行的实例,获取或设置用于注册任务的凭据以及描述任务的属性的方法.

Scripting object that provides the methods that are used to run the task immediately, get any running instances of the task, get or set the credentials that are used to register the task, and the properties that describe the task.

方法 RegisteredTask对象定义以下方法.

Methods The RegisteredTask object defines the following methods.

Method Description 
GetInstances Returns all instances of the registered task that are currently running. 
GetSecurityDescriptor Gets the security descriptor that is used as credentials for the registered task. 
GetRunTimes Gets the times that the registered task is scheduled to run during a specified time. 
SetSecurityDescriptor Sets the security descriptor that is used as credentials for the registered task. 
RunEx Runs the registered task immediately using specified flags and a session identifier. 
Stop Stops the registered task immediately. 
Run Runs the registered task immediately. 

属性 RegisteredTask对象具有以下属性.

Properties The RegisteredTask object has the following properties.

Property Description 
Definition Gets the definition of the task. 
Enabled Gets or set a Boolean value that indicates if the registered task is enabled. 
LastRunTime Gets the time the registered task was last run. 
LastTaskResult Gets the results that were returned the last time the registered task was run. 
Name Gets the name of the registered task. 
NextRunTime Gets the time when the registered task is next scheduled to run. 
NumberOfMissedRuns Gets the number of times the registered task has missed a scheduled run. 
Path Gets the path to where the registered task is stored. 
State Gets the operational state of the registered task. 
XML Gets the XML-formatted registration information for the registered task. 

示例代码[C ++] 有关此脚本对象的更多信息和示例代码,请参见时间触发示例(脚本)和显示任务名称和状态(脚本).

Example Code [C++] For more information and example code for this scripting object, see Time Trigger Example (Scripting) and Displaying Task Names and States (Scripting).

要求 客户端需要Windows Vista. 类型库使用Taskschd.tlb.

Requirements Client Requires Windows Vista. Type Library Use Taskschd.tlb.

DLL需要Taskschd.dll.

DLL Requires Taskschd.dll.

另请参阅 任务计划程序对象 任务计划程序

See Also Task Scheduler Objects Task Scheduler

将有关此主题的评论发送给Microsoft

Send comments about this topic to Microsoft

建立日期:2006年10月2日 语言 C ++

Build date: 10/2/2006 Language C++

显示全部 要求 客户端需要Windows Vista. 类型库使用Taskschd.tlb.

Show All Requirements Client Requires Windows Vista. Type Library Use Taskschd.tlb.

DLL需要Taskschd.dll.
也可以看看 任务计划程序对象 任务计划程序

DLL Requires Taskschd.dll.
See Also Task Scheduler Objects Task Scheduler

将有关此主题的评论发送给Microsoft

Send comments about this topic to Microsoft

建立日期:2006年10月2日

Build date: 10/2/2006

这篇关于查找计划任务向导任务信息的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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