Solved

NT Registry Read

Posted on 2000-05-16
10
231 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
by zero exception 10 69
JavaFX TableView not displaying correctly 3 100
Notify sent to other threads in Java 9 41
maven not picking latest jar instead picking old jar from .m2 12 42
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

679 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