Link to home
Start Free TrialLog in
Avatar of gaffneyr
gaffneyr

asked on

NT Registry Read

I have need to test a value in the Windows NT registry. Is there a way to do this from within Java?
Avatar of terajiv
terajiv

As far as I know through Java Directly u can not edit Registry or even play with it....
What exactly u want to do? Do u want to Install the Software and want to register tne No in registry? or just want to check it?

Rajiv
ASKER CERTIFIED SOLUTION
Avatar of erlingd
erlingd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
public class Bat  {
      public static void main(String args[]) throws Exception {

            Runtime r = Runtime.getRuntime();
            r.exec("regedit");
      
      }
}
Avatar of gaffneyr

ASKER

The reason why I want to read the NT registry is that we are have a problem where registry values are being over written in the course of the program and we need a tool to track the problem down. Thanks for your help.
Hi gaffneyr  && erlingd


class Reg {

      public static void main(String args[]){
            System.execute("Regedit.exe") ;      
      }
}


It first it won't compile.

There is no execute() method in
System class.

How Ur problem is solved ??

U have to use Runtime method's execute() only as in my commnet.

:)
Sorry ravindra76 - I was to quick :(

did not test it - before sending !
Hi gaffneyr,

Did ravindra76's comment solve your problem?

darinw
Customer Service
Thanks for your help. ravindra permits me to start REGEDIT but I still don't know any way to actually read the registry using only Java. Cay Horstmann's Core Java volume II has sample code to do this using JNI and C++.
Hmmm.

I credited your account with the points you used on this question so that you can post a new question. Be careful not to accept an answer until the problem you have posted is solved/answered/addressed.

darinw
Customer Service

Hi darinw ,

      You can debt my points in this question.

      Sorry for distrubing You

:)