Search code examples
javaruntimepromptuac

Don't show the UAC prompt when I run a program


Yesterday I asked a question on a Java Runtime. I resolved it myself, but now I'm insterested to don't show UAC prompt when I start my program. This program is an exe and it has the Administrator manifest.

Code :

Runtime.getRuntime().exec("cmd /c \"C:\\Program Files (x86)\\CodFiscExtractor\\MySQLServer\\MySqlStart.exe\"");

With this I start my program, but, how I said before, it displays me the uac prompt.

What I should do?


Solution

  • If the program that you start through your program requires administrator privileges the UAC prompt will show up. That's pretty much the reason for the UAC prompt!
    If you start your program as Administrator, you should be able to execute stuff with Admin privileges (that is, without UAC), but there will always be a prompt at one place or another (as long as the UAC is not turned off).