0
votes

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?

2
Is the program that is starting that program running in administrator mode?Andreas Hartmann
No, the program starting that program is a jarGabriel
You can run jars in administrator mode Gabriel. That doesn't answer his question. Its irrelevant though, you'll see the UAC prompt either way.SpacePrez
@SpacePrez oh ok, sorry ;) Thanks!Gabriel
What is the benefit of using cmd /c here?VGR

2 Answers

2
votes

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).

1
votes

You cannot. This is controlled by Windows at the OS level. UAC would have zero point if programs could simply avoid it.

Either write a program that doesn't call executables, or accept that UAC will trigger. That's not your choice.