While I am opening services in C# I am getting User Account Control window. How to send answer[yes/no] to UAC? I do not want to disable UAC.
C# code:
System.Diagnostics.Process.Start("services.msc");
While I am opening services in C# I am getting User Account Control window. How to send answer[yes/no] to UAC? I do not want to disable UAC.
C# code:
System.Diagnostics.Process.Start("services.msc");
The simple answer is that you are not allowed to do that. If you were, that would pretty much defeat the purpose of UAC. The UAC consent dialog is shown on a different desktop, the secure desktop, and as such your program cannot communicate with it.
I don't expect you will be pleased to hear this news. Perhaps there is a different solution to your underlying problem, but handling the consent dialog on behalf of the user is not it.