Opened 10 years ago
Closed 4 years ago
#3015 closed Bug (Rejected)
Object Schedule.Service
Reported by: | syperjazz@… | Owned by: | |
---|---|---|---|
Milestone: | Component: | AutoIt | |
Version: | 3.3.13.20 | Severity: | None |
Keywords: | Schedule.Service GetTask | Cc: |
Description
I did not test all Beta versions. On 3.3.13.5 it is working. And on 3.3.13.19 and 3.3.13.20 it does not work.
Example code:
Func _TaskExists($taskname, $folder = "\");check if a Task exists
;If Not _TaskIsValidPlatfrom() Then Return SetError(2, 2, 0)
Local $oService, $oFolder
$oService = ObjCreate("Schedule.Service")
$oService.Connect()
$oFolder = $oService.GetFolder($folder)
If IsObj($oFolder) Then
$oTask = $oFolder.GetTask($taskname) ;here is the error with newer beta versions
If IsObj($oTask) Then
$oService = 0
Return 1
Else
$oService = 0
SetError(1)
Return 0
EndIf
Else
$oService = 0
SetError(1)
Return 0
EndIf
EndFunc
_TaskExists("test")
Attachments (0)
Change History (3)
comment:1 Changed 9 years ago by mLipok
comment:2 Changed 9 years ago by mLipok
I also test on 3.3.12.0
Your examples give the same error in $oFolder.GetTask($taskname)
as:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa381353(v=vs.85).aspx
saying that you must set "The path (location) to the task in a folder."
For clarity I would like to say: Full Path to the an EXISTING task in a folder.
You are using only $taskname without folder, and you do not check if this task exists.
comment:3 Changed 4 years ago by Jpm
- Resolution set to Rejected
- Status changed from new to closed
no more info so I close it
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa381353(v=vs.85).aspx
My console output:
You should enumerate Tasks something like this: