Needing help with the Elevate Module
Archived a year ago
T
true_lock
Active!
Hi,
I'm working on a Python cleanup, information gathering, and repair tool for Windows. I need to run some CMD commands as an administrator. Initially, I used runas for this, which worked, but I was advised that this might be why my program gets flagged by Windows Defender. runas is often used by malware, which could be causing the issue.
To address this, I tried the elevate module. When I click a button that uses the run_window_admin_command or run_admin_command function, I get a notification, the program asks for admin permissions, restarts, and the old program window closes, which is great. However, the problem is that if I click the button again in the new window, it repeats the same process and doesn’t execute the command as intended.
I have included the full code and the specific code snippet in an extra file as an attachment. If someone could help me, I would be incredibly grateful. I've been struggling with this for hours.
Thank you!
