This is for Window 7 and Window 10
We have requirement to generate jar inside c:program file only. Installer can easily install our jar into c:\\ProgramFile\\testapp
. After that we have the requirement to download the zip file from third party server inside c:\\ProgramFile\\testappp
and here we are getting the access denied.
After lot of research, we come to know, we can run our jar under administrator privileges using super-user-application-0.0.5.jar
.
Now the problem is We are getting the "User account control popup" with message "Do you want to allow the following program to make changes to this computer"
We don't want this popup so anyone know how to bypass this popup?
The important code from super-user-application-0.0.5.jar is
Shell32X.SHELLEXECUTEINFO execInfo = new Shell32X.SHELLEXECUTEINFO()
execInfo.lpParameters = args
execInfo.lpDirectory = lpDirectory
execInfo.fMask = Shell32X.SEE_MASK_NOCLOSEPROCESS
execInfo.lpVerb = "runas"
boolean result = Shell32X.INSTANCE.ShellExecuteEx(execInfo)
execInfo.lpVerb = "runas"
is actually opening the popup. Is there any way, just bypass the popup and further processing should be similar to the saying OK to the popup.
Any chance to java programatically provide admin rights to the testapp folder created inside c:\ProgramFile\testapp