我知道有一個用於查找計算機的計劃任務的命令,但我想要獲得關於計劃任務本身的更多信息。我想知道計劃任務的執行時間和時間,以及計劃任務的名稱和區域。有任何想法嗎?用於查找計劃任務嚮導任務信息的腳本
0
A
回答
0
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
從幫助中,其中一些是其他信息的對象。
RegisteredTask
腳本對象,它提供了用於立即運行任務,獲得任務的所有正在運行的情況下,獲取或設置用於註冊任務憑據的方法,以及描述屬性任務。
方法 RegisteredTask對象定義了以下方法。
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對象具有以下屬性。
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++] 有關此腳本對象的詳細信息和示例代碼,見時間觸發實施例(腳本)和顯示任務名稱和國家(腳本)。
要求 客戶端需要Windows Vista。 類型庫使用Taskschd.tlb。
DLL需要Taskschd.dll。
另請參見 任務計劃程序對象 任務計劃
發送有關這個主題的評論微軟
構建日期:2006年10月2日 語言 C++
顯示所有 要求 客戶端需要Windows Vista。 類型庫使用Taskschd.tlb。
DLL需要Taskschd.dll。
請參見 任務計劃程序對象 任務計劃
發評論有關此主題的微軟
構建日期:2006年10月2日
相關問題
- 1. Windows 2008 - 任務計劃程序信息
- 2. WebClient計劃任務計劃任務
- 3. 啓動計劃的任務從腳本
- 4. 在運行電源shell腳本的計劃任務中創建計劃任務
- 5. 按計劃任務運行Powershell腳本
- 6. PowerShell腳本作爲計劃任務
- 7. Plesk計劃任務 - 運行多個腳本與多個任務
- 8. 計劃任務
- 9. XPath查詢計劃任務
- 10. 使用Powershell腳本啓用/禁用任務計劃程序中的任務
- 11. 僞任務的任務計劃程序
- 12. 尋找關於如何從powershell更改計劃任務的設置的信息
- 13. 用於創建計劃任務的VBScript
- 14. ASP.NET:計劃任務
- 15. VB.NET計劃任務
- 16. MySQL - 計劃任務
- 17. PowerShell計劃任務
- 18. Oracle計劃任務?
- 19. Java:計劃任務
- 20. 如何從Powershell腳本調用任務計劃程序中的任務?
- 21. Windows任務計劃程序C中的計劃任務#
- 22. 編輯任務計劃任務C#
- 23. 春任務執行計劃任務
- 24. 任務計劃程序 - 將歷史信息獲取到腳本變量中
- 25. 使用計劃任務
- 26. Schtasks沒有找到計劃的任務
- 27. 計劃任務不會出現在任務計劃
- 28. spring任務:計劃任務默認計劃程序池大小
- 29. SSIS腳本任務查找數據
- 30. 取的計劃任務
爲也發現同樣的命令列出的屬性。 'schtasks/query/tn「Task Name」/ v/fo list' – phd443322
@ phd443322這很好,謝謝 – giacmeister