Answer the question
In order to leave comments, you need to log in
How to set exe to run with administrator rights by default?
I have a runasadmin.py file
I compile it in pyinstaller exe
There is a part of the code that needs admin privileges to work, so you need to check the box "always with admin privileges"
Each time they are requested, and you need that the prompt for elevation does not open, and immediately resolved
the Question, how?
Answer the question
In order to leave comments, you need to log in
The only way to exclude the request for a login password or the request for exceedance is to run through the task scheduler.
A task is created, without a launch trigger, the desired application is indicated and the administrator's login password is set, as well as the flag with the highest rights is indicated, allow launch on demand and uncheck the box - a hidden task.
To run later, you need to execute the command (indicate it in the shortcut)
schtasks.exe /run /tn имя_задачи
but it is necessary that the request for elevation of rights is not opened, but immediately allowedForget security and turn off UAC.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question