Get list of tasks from windows task sheduler with python -


how can list of tasks in "/" folder of windows task scheduler? seems doesn't exist simple recipe. while searching i've found no suitable solution. have idea?

upd:

solved in such way:

def parse_sheduler(root, tasks_to_check): # reads task sheduler list , returns dict tasks. taskexistsmark = true tasklist = subprocess.check_output(["schtasks.exe", "/fo", "csv"]) tasklist_dict = {} line in tasklist.splitlines()[1:]:     if not line.startswith('"\\'):  # skip not folder name starting lines         continue     folder = line.rsplit("\\", 1)[0][1:]     taskname = line.rsplit("\\", 1)[1].split('"')[0]     nextrun = line.rsplit("\\", 1)[1].split(",")[1].replace('"','')     status = line.rsplit("\\", 1)[1].split(",")[2].replace('"','')     if folder == "": folder = "\\"     # print folder, taskname, nextrun, status     if folder not in tasklist_dict:         tasklist_dict[folder] = {}     tasklist_dict[folder][taskname] = {}     tasklist_dict[folder][taskname]["nextrun"] = nextrun     tasklist_dict[folder][taskname]["status"] = status return tasklist_dict 

any better idea?


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -