Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run java application as administrator priviledge in XP

Tags:

java

I have created a small program in java which reads the UninstallString of an application from registry and then using

Process p = Runtime.getRuntime.exec("command") 

to uninstall this application. But this task require administrator priviledge.

On Windows Vista, 7 and 8 this work fine by creating a bat file with the following command "java -jar java_app.jar", right click on the bat file and run as administrator.

But on XP, my account is an administrator account but still it fails to run the java program as administrator.

Can anyone provide me with some solutions which can solve this problem?

like image 720
nasiroudin Avatar asked Feb 14 '13 09:02

nasiroudin


People also ask

How to run applications without administrator privileges in Windows 10?

To do it, we create the RunAsUser.REG file and copy the following code into it. Then we save and import it into the Windows registry by double-clicking on the reg file. After that, to run any application without the administrator privileges, just select “Run as a user without UAC privilege elevation” in the context menu of File Explorer.

How do I run a program with administrator rights in Windows?

To let standard users run a program with administrator rights, we are using the built-in Runas command. To start, you need to know two things before you can do anything. The first is the computer name, and the second is the username of your administrator account. If you don’t know the computer name, press Win + X, then select the “System” option.

How to run REGEDIT without administrator privileges?

We create the text file run-as-non-admin.bat containing the following code: We can force the regedit.exe to run without the administrator privileges and suppress the UAC prompt. For that, we simply drag the EXE file we want to start to this BAT file on the desktop.

What permissions do I need to install Java on Windows?

You need Administrative Permission to install Java. For Windows XP, Windows Vista and Windows 7 Operating systems, there are different types of user accounts (e.g. guest or administrator). Administrative accounts are needed to install software and make other changes to the computer.


1 Answers

You can use RunAs command:

RUNAS /TrustLevel:Unrestricted notepad.exe

You can find trust levels available on you system:

RUNAS /ShowTrustLevels

The following liks explains that in more details http://blog.johnmuellerbooks.com/2011/04/26/simulating-users-with-the-runas-command.aspx

like image 72
Omar MEBARKI Avatar answered Oct 30 '22 05:10

Omar MEBARKI