aspose file tools*
The moose likes Java in General and the fly likes How to add key to windows registry?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to add key to windows registry??" Watch "How to add key to windows registry??" New topic
Author

How to add key to windows registry??

Supun Lakshan Dissanayake
Ranch Hand

Joined: Oct 26, 2012
Posts: 132

I want to read or write registry key to windows registry using a java programme.
registry key is like "HKEY_LOCAL_MACHINE\SOFTWARE\KasperskyLab\protected\AVP12" // this registry key is a SAMPLE
How to do it?

Regards!!


Are you better than me? Then please show me my mistakes..
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41571
    
  54
The http://www.coderanch.com/how-to/java/JavaIoFaq links to the solution.


Ping & DNS - my free Android networking tools app
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2849
    
  11

I've never used it myself, but I believe the Java API class java.util.prefs.Preferences uses the Windows registry as its store when running on Windows. Its abilities to read and write registry keys would be limited, but depending on your requirements might be enough. If you need more flexibility, then you'll need to write (or find to download) a JNI interface for this job. Here another thread that might point you in the right direction: http://www.coderanch.com/t/517229/java/java/Editing-reading-windows-registry-java
 
jQuery in Action, 2nd edition
 
subject: How to add key to windows registry??