S
S
Sanders2019-02-24 16:34:02
C++ / C#
Sanders, 2019-02-24 16:34:02

How to request access rights for a program using WinAPI?

For example, there is a program that simply creates a folder in some path. Let's say you need to create a folder in System, and this requires administrator rights. How to write a program so that when the program starts, a window opens about granting administrator rights (UAC)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
none7, 2019-02-24
@none7

If admin rights are always required, see Setting the Execution Level in the Application Manifest . Otherwise, launching the program via ShellExecute("runas") and passing the necessary data to the child process.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question