Jump to content

List Scheduled Tasks in Task Scheduler Library


GreenCan
 Share

Recommended Posts

This script will get all Scheduled tasks as defined on a system

There are basically 3 functions in this small udf:

  1. _TaskGetFolders() will return an array of all folders as from a given Scheduler Library folder, recursively. $aFolders will have to be declared before the function is called, I am not sure if there is a better method to avoid having to declare the array outside of _TaskGetFolders()...
  2. _TaskListAllDetailed() will return a detailed array of all tasks in a given task folder, recursively. This function is using _TaskGetFolders() for the recurse option.
  3. _TaskListToText() will create a formatted output of scheduled tasks as returned to the above array.

The script is complementary to taskplanerCOM.au3 by Allow2010.

The example shows

  • all folders in the Scheduler Library
  • All scheduled tasks in root (with formatted output)
  • All scheduled tasks on the system
  • Scheduled tasks Windows Defender if available

_TaskListAllDetailed.au3

 

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

I get an error after the array window:

 

>Running:(3.3.13.19):C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe "C:\_Downloads\_TaskListAllDetailed.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"C:\_Downloads\_TaskListAllDetailed.au3" (156) : ==> The requested action with this object has failed.:
$aResult[$iRows][14] = $oTaskAction.ClassId
$aResult[$iRows][14] = $oTaskAction^ ERROR
->15:13:11 AutoIt3.exe ended.rc:1
Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

I get an error after the array window:

 

>Running:(3.3.13.19):C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe "C:\_Downloads\_TaskListAllDetailed.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"C:\_Downloads\_TaskListAllDetailed.au3" (156) : ==> The requested action with this object has failed.:
$aResult[$iRows][14] = $oTaskAction.ClassId
$aResult[$iRows][14] = $oTaskAction^ ERROR
->15:13:11 AutoIt3.exe ended.rc:1
Br,

UEZ

 

Hi UEZ,

Just to be sure, are you using Windows XP or Vista/7 ?

I commented out _TaskIsValidPlatfrom() ...

The udf will only function for Task Scheduler 2.0 (Vista or above...)

Edited by GreenCan

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

I'm using Win 8.1 Enterprise.

Br,

UEZ

OK, I will test it on my 8.1 tablet later today...(no Autoit installed on this device unfortunately)

I'll come back to you afterwards.

Meanwhile, I checked msdn but there is nowhere mentioned that it would not work with 8.1

http://msdn.microsoft.com/en-us/library/windows/desktop/aa446821%28v=vs.85%29.aspx

Edited by GreenCan

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

I'm using Win 8.1 Enterprise.

Br,

UEZ

Tried It on my 8.1 pro tablet and got no issue.

Can I suggest to comment out classid and check if the rest of the script works fine?

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

The methods for $oActions = $oTaskDefinition.Actions (line 154-179) are not working running AutoIt v3.3.12.0.

For latest beta additionally $colTaskTriggers = $oTaskDefinition.Triggers is not working (line 273 - 290).

The rest seems to work.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

The methods for $oActions = $oTaskDefinition.Actions (line 154-179) are not working running AutoIt v3.3.12.0.

For latest beta additionally $colTaskTriggers = $oTaskDefinition.Triggers is not working (line 273 - 290).

The rest seems to work.

Br,

UEZ

 

I tried it with both v3.3.10.2 and v3.3.12.0, no issue on my system. This is really weird as ClassId and Data are valid properties for the ComHandlerAction object.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa446820(v=vs.85).aspx

ClassId results is something like this (extract from xml):  <ClassId>{CF2CF428-325B-48D3-8CA8-7633E36E5A32}</ClassId>

Idem for the trigger object.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa383868%28v=vs.85%29.aspx

Not sure how I can help with this.


Does anyone else have the same issue as UEZ please?


Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

  • 8 months later...

Same issue for me on Win 7

"O:\#   Tailored\#  Tech Toolz Code\Toolz\Scheduled Task Remover\_TaskListAllDetailed.au3" (156) : ==> The requested action with this object has failed.:
$aResult[$iRows][14] = $oTaskAction.ClassId
$aResult[$iRows][14] = $oTaskAction^ ERROR
->11:20:09 AutoIt3.exe ended.rc:1

Shows the first array then throws an error

Link to comment
Share on other sites

Yep i went this way after some experimentation

Global $filename = '"' & @ScriptDir & '\Logs\tasklist_logs\' & @OSVersion & '-' & @UserName & '-' & @MDAY & '-' & @MON & '-' & @MIN & '-' & @SEC & '"'
RunWait(@ComSpec & ' /c ' & 'schtasks.exe /query /v /fo CSV >' &  $filename & '-tasklist.csv', '', @SW_HIDE)

 

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...