From 2f655787e5e2f6d6c4b102c84ea080e30da956f8 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Fri, 15 Oct 2021 01:04:36 -0600 Subject: [PATCH] Avoid if quitting Auto Repairs without running it i.e. Opened the script, get to the main menu, and then exit. --- scripts/wk/repairs/win.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/wk/repairs/win.py b/scripts/wk/repairs/win.py index 7387ed02..ab0c0082 100644 --- a/scripts/wk/repairs/win.py +++ b/scripts/wk/repairs/win.py @@ -167,9 +167,13 @@ def end_session(): LOG.error("Failed to remove scheduled task or it doesn't exist.") # Disable Autologon - autologon_selected = reg_read_value( - 'HKCU', AUTO_REPAIR_KEY, 'Use Autologon', - ) + try: + autologon_selected = reg_read_value( + 'HKCU', AUTO_REPAIR_KEY, 'Use Autologon', + ) + except FileNotFoundError: + autologon_selected = False + # Assuming it isn't being used if autologon_selected and is_autologon_enabled(): run_tool('Sysinternals', 'Autologon', download=True) reg_set_value(