Solved

NT Registry Read

Posted on 2000-05-16
10
218 Views
Last Modified: 2010-04-01
I have need to test a value in the Windows NT registry. Is there a way to do this from within Java?
0
Comment
Question by:gaffneyr
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 3

Expert Comment

by:terajiv
ID: 2815987
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
 

Accepted Solution

by:
erlingd earned 50 total points
ID: 2816038
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
 
LVL 7

Expert Comment

by:Ravindra76
ID: 2817025
public class Bat  {
      public static void main(String args[]) throws Exception {

            Runtime r = Runtime.getRuntime();
            r.exec("regedit");
      
      }
}
0
 

Author Comment

by:gaffneyr
ID: 2818083
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
 
LVL 7

Expert Comment

by:Ravindra76
ID: 2819796
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Expert Comment

by:erlingd
ID: 2820294
Sorry ravindra76 - I was to quick :(

did not test it - before sending !
0
 
LVL 3

Expert Comment

by:darinw
ID: 2824349
Hi gaffneyr,

Did ravindra76's comment solve your problem?

darinw
Customer Service
0
 

Author Comment

by:gaffneyr
ID: 2826498
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
 
LVL 3

Expert Comment

by:darinw
ID: 2826688
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
 
LVL 7

Expert Comment

by:Ravindra76
ID: 2826739

Hi darinw ,

      You can debt my points in this question.

      Sorry for distrubing You

:)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now