0

I am creating app what starting another process by processStart method and because app what I am starting require administrator privilege I set the ruans verb. Second think what i want to do is that started process will not show any form. My code is:

Process process = new Process();
process.StartInfo = new ProcessStartInfo("sdfsdf", "sdfasdgdf");
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.Verb = "runas";
process.Start();

But the problem is that process.StartInfo.CreateNoWindow creates no windows and it applies to creating UAC window, what is needed to show. How to allow showing UAC window but no other?

1

1 Answer 1

1

Instead of starting the 'target' app directly like this, instead create a small 'helper' app that does nothing but start the target app with CreateNoWindow.

Then you start your 'helper' app with 'runas' and without CreateNoWindow, since your 'helper' app won't create any windows that's not a problem, and since it was run with 'runas' it'll be able to run other elevated programs without 'runas' itself - and can therefore use CreateNoWindow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.