Solved

NT Registry Read

Posted on 2000-05-16
10
215 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
Comment Utility
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
Comment Utility
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
Comment Utility
public class Bat  {
      public static void main(String args[]) throws Exception {

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

Author Comment

by:gaffneyr
Comment Utility
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
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Expert Comment

by:erlingd
Comment Utility
Sorry ravindra76 - I was to quick :(

did not test it - before sending !
0
 
LVL 3

Expert Comment

by:darinw
Comment Utility
Hi gaffneyr,

Did ravindra76's comment solve your problem?

darinw
Customer Service
0
 

Author Comment

by:gaffneyr
Comment Utility
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
Comment Utility
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
Comment Utility

Hi darinw ,

      You can debt my points in this question.

      Sorry for distrubing You

:)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
parentbit challenge 3 50
where is session ID cache stored 1 38
java set up 1 44
Java / Linux and Regular Expressions 11 42
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

763 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

6 Experts available now in Live!

Get 1:1 Help Now