I want to extract a zip archive to "C:\\" (just for testing purpose). Therefore I need admin rights, so I am trying to elevate the current user to get admin rights.
if __name__ == "__main__":
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)
main()
The invoking message from UAC is comming as it should but when I want to extract the zip I am still getting "IOError: [Errno 13] Permission denied".
What am I doing wrong here?