Q
Q
qwertiss2021-05-07 09:16:28
Windows
qwertiss, 2021-05-07 09:16:28

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

3 answer(s)
R
rPman, 2021-05-07
@rPman

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 имя_задачи

V
Vasily Bannikov, 2021-05-07
@vabka

by fixing compatibility issues

A
Artem @Jump, 2021-05-07
curated by the

but it is necessary that the request for elevation of rights is not opened, but immediately allowed
Forget security and turn off UAC.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question