I have a command line utility for some purpose. I start this utility from a COM DLL using ShellExecuteEx function. When calling ShellExecuteEx, i specify the lpVerb parameter as "runas" so that the utility is started elevated. I call the COM Interface function from an exe client on its startup. So when i start the client exe, the utility is also started. My problem is that since the utility is started elevated, it always asks for the UAC confirmation prompt. I can't stand this because there will be no manual intervention during this process. So I need the utility to be started without showing the UAC prompt, but still elevated when i start the client exe. Is there any way to achieve this? I would prefer some changes done within the utility itself like changing the manifest file rather than some system settings changes. Any help will be appreciated..
0
votes
1 Answers
1
votes
This is not possible the way you describe (manifest change) because this would defeat the purpose of UAC.
You can, however, use a scheduled task. This way, elevation with user interaction is required only once (when the task is created).
Take a look at the answer I've given here: https://stackoverflow.com/a/36838171/1871033
You can do the same, but without a logon trigger. So you will have a scheduled task which doesn't run on its own, but it exists. You can then use schtasks.exe /run /tn YourTaskName
without elevation to run the task with elevated privileges.