Jump to content

Would you like to see a brushed up Task Scheduler UDF (inlcuding help files, examples ...)?  

39 members have voted

  1. 1. Would you like to see such a brushed up UDF?

    • Yes
    • Don't mind
    • Maybe later
      0
    • No
      0


Recommended Posts

Posted (edited)

@FrancescoDiMuro

https://www.autoitscript.com/forum/index.php?showtopic=135994

https://www.autoitscript.com/forum/index.php?showtopic=83355

Edit :

  Quote

Based on a discussion on the german forum we would like to create a new UDF based on the existing "template" UDFs.

Expand  

You will find the discussion under : https://autoit.de/index.php?thread/86586-windows-aufgabenplanung-per-schtasks-exe-einen-task-erstellen-und-abfragen/&pageNo=1

BTW : After years of reading, this is my first post here 🙂.

 

Edit 2 : @FrancescoDiMuro

Thank you for your friendly welcome. I'm editing this in my post here because I don't want to disturb the main thread ;).

Greetings Musashi

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted

This links can be found in the wiki as well: https://www.autoitscript.com/wiki/User_Defined_Functions#Windows

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)

@Musashi, @water

Thanks for the links!

  On 8/25/2019 at 11:50 AM, Musashi said:

BTW : After years of reading, this is my first post here 🙂.

Expand  

Welcome actively in this wonderful community! :welcome:

EDIT:
@water
The UDF by Allow2010 is more complete and already uses objects, so, it could be a point from where to start the new UDF.
So, just wait for others for votes :)

Edited by FrancescoDiMuro

Click here to see my signature:

  Reveal hidden contents

 

Posted

That's what we intend to do because the other UDF uses Sc.exe and is a few years older.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)

I think that you should consider having functions that create the task object and have users use functions to edit the task object's properties before finally registering it... Maybe something like this:

;"Create the task"
Local $oTask = _Task_Create()
;"Schedule the task for once every day at 5pm"
_Task_ScheduleDaily($oTask, 17)
;"Run asap if missed"
_Task_RunIfMissed($oTask, True)
;"Register the task"
_Task_Register($oTask)

Edit: I suggest this to avoid having a HUGE param list like in Allow2010's... though he did a really nice job, his function is just ugly :)

Edited by seadoggie01

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

  Reveal hidden contents
Posted

I would like to fully compatibility with Au3Check and Au3Stripper.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 8/25/2019 at 12:24 PM, FrancescoDiMuro said:

The UDF by Allow2010 is more complete and already uses objects, so, it could be a point from where to start the new UDF.

Expand  

I will add requirements from the posts to thread #1 so we have everthing at a single place.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted
  On 8/25/2019 at 5:30 PM, seadoggie01 said:

I think that you should consider having functions that create the task object and have users use functions to edit the task object's properties before finally registering it

Expand  

There will be a function to set/modify all properties of a task. To limit parameters you will be able to group them (as MS did with properties grouped for Task, Definition, Actions, Principal, Registration, Settings, Triggers) and pass them as arrays to the task create or the task modify function.
There will be wrapper functions available for simple tasks. You pass a few parameters to this wrappers and they do all the work for you in the background.

I intend to create a function that retrieves all properties from a task and returns it the way the task create function expects them.
This means:

  • You could create and test a task using the task management GUI provided by Microsoft
  • extract the properties from this template using the UDF function
  • do the needed modification and then
  • copy the result to your script.

Comments?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)
  On 8/25/2019 at 7:43 PM, water said:

Comments?

Expand  

Well, you said almost everything about the new functionalities of the UDF and they would be just amazing!

Maybe write down a list of functions, and a short explanation of what they should/could do.

In this case, people can comment and you can get more "inspiration" for the UDF :)

Edited by FrancescoDiMuro

Click here to see my signature:

  Reveal hidden contents

 

Posted (edited)

It would also be nice to have functions to import and export XML files of tasks.  I started writing a wrapper for the command line way to do it.  I'm not sure if it can be done with COM.  I've also just started working on updating Allow2010's UDF.  

Edit: Sounds like this is already mentioned in your plan.

Adam

Edited by AdamUL
Posted

At least export of the XML with COM is easy. And already on its way with function TaskPropertiesGet.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

How you plan to maintain COM Error Handler in this UDF?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

It would be good if examples will show the same problems as here:
https://docs.microsoft.com/pl-pl/windows/win32/taskschd/using-the-task-scheduler

of course, using this UDF.

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 8/26/2019 at 7:00 AM, mLipok said:

How you plan to maintain COM Error Handler in this UDF?

Expand  

The same way as in OutlookEx and all my other UDFs. I want to spend my time working on the UDF, not on handling COM errors. 

This has worked quite well since Jon changed the COM error handling the last time. 

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

I posted the first ALPHA for you to play with in the download section.
Have fun!

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

Is this necessary to declare $oFolder in this following case:

Func _TS_FolderExists($oService, $sFolder)
    Local $oFolder = $oService.GetFolder($sFolder)
    If @error Then Return 0
    Return 1
EndFunc   ;==>_TS_FolderExists

 

?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Few proposals for Au3Check compatibility

 

TaskScheduler.au3Fetching info...

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

No. Can be stripped down down to

$oService.GetFolder($sFolder)

But I'm sure we will make a beauty queen of this UDF at the end of the development ;)

My UDFs and Tutorials:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...