How to create new Registry node AND value NOT in HKCU\Software\Javasoft\Prefs ?

M

Mark Sizzler

I would like to write some values into a new/existing key in the Registry.

An often shown example is the following:

....
Preferences p = Preferences.userRoot();
p.put("aBbbCccDdd", "bar");
...

This example has multiple disadvantages and problems:

1.) The values are always written to the branch:

HKCU\Software\Javasoft\Prefs

How do I write them to:

HKCU\Software\MySoft123 ?

2.) The example above shows how to create a new value but NOT how to create
a new key. How do I create a new key?

3.) The value name which is created by the example above is NOT as expected "aBbbCccDdd"
but "a\Bbb\Ccc\Ddd" instead.
Are capital letters ALWAYS automatically masked ?
How can I put capital letters into value names without masking?

4.) The example above shows how to store strings (REG_SZ) values in Registry but not how to
store numbers. How do I store numbers?

To sum up all I would like to do store the following:

HKCU\Software\MySoft123 Value=aBbbCccDdd Type=REG_SZ Data="bar"
and
HKCU\Software\MySoft123 Value=YyyZzz Type=REG_DWORD Data=888 (decimal)

How can I achieve this?

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top