Solved

NT Registry Read

Posted on 2000-05-16
10
223 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
java 8 lambda expresssions exception handling 3 90
what is a "java.lang.System Property"   ? 20 67
HSSFWorkbook cannot be resolved error 10 69
tomcat not starting 6 45
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

773 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