From 9de9c9704ea528a79c076c4a8692f83cff4f0ae2 Mon Sep 17 00:00:00 2001 From: Sean <61057625+ShadowWhisperer@users.noreply.github.com> Date: Thu, 1 Jun 2023 23:55:02 -0500 Subject: [PATCH] Update gui.py Fixed - Hide cmd opening/flashing when deleting tasks --- _Source/gui.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_Source/gui.py b/_Source/gui.py index 8ccf15e..b844b7b 100644 --- a/_Source/gui.py +++ b/_Source/gui.py @@ -152,19 +152,19 @@ def remove_edge(): except Exception: pass - #Tasks - Name - result = subprocess.run(['schtasks', '/query', '/fo', 'csv'], capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW) + # Tasks - Name + result = subprocess.run(['schtasks', '/query', '/fo', 'csv'], capture_output=True, text=True, startupinfo=hide_console()) tasks = result.stdout.strip().split('\n')[1:] microsoft_edge_tasks = [task.split(',')[0].strip('"') for task in tasks if 'MicrosoftEdge' in task] with open(os.devnull, 'w') as devnull: for task in microsoft_edge_tasks: output_terminal.insert(END, f" Task: {task}\n") root.update() - subprocess.run(['schtasks', '/delete', '/tn', task, '/f'], check=False, stdout=devnull, stderr=devnull) + subprocess.run(['schtasks', '/delete', '/tn', task, '/f'], check=False, stdout=devnull, stderr=devnull, startupinfo=hide_console()) - #Tasks - Files + # Tasks - Files for tsks, dirs, files in os.walk(r"C:\Windows\System32\Tasks"): - [os.remove(os.path.join(tasks, file)) for file in files if file.startswith("MicrosoftEdge")] + [os.remove(os.path.join(tasks, file)) for file in files if file.startswith("MicrosoftEdge")] #Edge Update Services service_names = ["edgeupdate", "edgeupdatem"]