I am writing an app that starts a command line applications and processes this application's output. For this I am using Xojo's shell class.
I would like to be able to start the other application with admin privileges. When I start the other application the user should be asked for privilege escalation via the normal Windows UAC prompt.
There are three avenues I have tried so far:
Using VBS as documented here: https://docs.xojo.com/UserGuide:Elevating_User_Access_Control
This does not seem to work anymore. The vbs file is automatically deleted when I try to execute it - probably by windows defender.
Using the runas command in the command line.
But with runas Windows does not open the UAC prompt, but asks for the password inside the terminal.
Using ShellExecuteW as documented here: https://forum.xojo.com/2933-shell-command-in-adminstrator-mode/0
ShellExecuteW opens the UAC prompt and runs the application with admin privileges. But I do not have the ability to stream process the applications output.
Do you have any other ideas?
Thank you :-)