From b398ecf07267a92876332fae562c9eddb41878a9 Mon Sep 17 00:00:00 2001 From: "Pedro Almeida Garcia (almeidagaj)" Date: Tue, 30 Nov 2021 18:38:52 +0000 Subject: [PATCH] Add files via upload --- Final Version CW2.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Final Version CW2.py b/Final Version CW2.py index 68c4e6d..35fc8c8 100644 --- a/Final Version CW2.py +++ b/Final Version CW2.py @@ -91,16 +91,6 @@ def menu(): print("What Method would you like to use") option = (input("\n1. Admin CMD\n2. Method 2\n3. Method 3\n")) if option == "1": - import os - import sys - import win32com.shell.shell as shell - ASADMIN = 'asadmin' - - if sys.argv[-1] != ASADMIN: - script = os.path.abspath(sys.argv[0]) - params = ' '.join([script] + sys.argv[1:] + [ASADMIN]) - shell.ShellExecuteEx(lpVerb='runas', lpFile=sys.executable, lpParameters=params) - sys.exit(0) print("Do you want to quit or return to menu?") option = (input("y or n\n")) if option == "y": @@ -215,6 +205,16 @@ def menu(): print("What Method would you like to use") option = (input("\n1. Method 1\n2. Method 2\n3. Method 3\n")) if option == "1": + import os + import sys + import win32com.shell.shell as shell + ASADMIN = 'asadmin' + + if sys.argv[-1] != ASADMIN: + script = os.path.abspath(sys.argv[0]) + params = ' '.join([script] + sys.argv[1:] + [ASADMIN]) + shell.ShellExecuteEx(lpVerb='runas', lpFile=sys.executable, lpParameters=params) + sys.exit(0) print("Do you want to quit or return to menu?") option = (input("y or n\n")) if option == "y":