• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

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?
0
gaffneyr
Asked:
gaffneyr
  • 3
  • 2
  • 2
  • +2
1 Solution
 
terajivCommented:
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
0
 
erlingdCommented:
Use System.execute("Regedit.exe")

see Regedit.exe or regedt32.exe for commandline options.

There is one option for exporting til reg. or some of it - to a file.

// or is that in another program ? ;-)
0
 
Ravindra76Commented:
public class Bat  {
      public static void main(String args[]) throws Exception {

            Runtime r = Runtime.getRuntime();
            r.exec("regedit");
      
      }
}
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
gaffneyrAuthor Commented:
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.
0
 
Ravindra76Commented:
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.

:)
0
 
erlingdCommented:
Sorry ravindra76 - I was to quick :(

did not test it - before sending !
0
 
darinwCommented:
Hi gaffneyr,

Did ravindra76's comment solve your problem?

darinw
Customer Service
0
 
gaffneyrAuthor Commented:
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++.
0
 
darinwCommented:
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
0
 
Ravindra76Commented:

Hi darinw ,

      You can debt my points in this question.

      Sorry for distrubing You

:)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now