Friday, June 5, 2009

Read/Write windows registry entries using Java

In one of my application , where I had to read/write entries on windows registry using Java. These are the two jar files which I found extermely useful.

Windows Registry Wrapper

This help us to read/write REG_DWORD and REG_BINARY also.

Below is a sample code I used with the jar file

import at.*;
import at.jta.*;

public static void main(String[] args) throws RegistryErrorException

Regor obj = new Regor();
Key key = obj.openKey(Regor.HKEY_CURRENT_USER, "Software\\Custom Writer");
int count = 0;
count = Integer.parseInt(obj.readDword(key, "StartAt"));


Java Registry Wrapper

The source code and .jar files are available in the google code store. (

This will help us to read/write the REG_SZ (registry string characters)

Some other helpful links:

No comments:

Post a Comment