Setting a binary registry value to 1 results in value of 31. Setting the value to 0 results in a value of 30. I found that the unicode value for 1 is u0031 and unicode value for 0 is u0030 so I think there is a connection.

Here is what I am doing.

<registrySet> <key>HKEY_LOCAL_MACHINE\SOFTWARE\TEST\KEYNAME</key> <name>TestBinaryValue</name> <type>REG_BINARY</type> <value>1</value> </registrySet>

The value name is created correctly as a binary (also tried with type "none" - same result). How can I set the binary value to 1?

asked 11 Sep '12, 09:31

HJM's gravatar image

accept rate: 0%

The value for REG_BINARY is expected to be in binary form already.

In general, it is recommended to simply ship a .reg file and simply run reg import command. For example it is possible to ship registry.reg as one of the files - such as:

Windows Registry Editor Version 5.00


And then run reg command:

    <programArguments>import "${installdir.dos}\registry.reg"</programArguments>

However, in this case it is also possible to use <decodeBase64> action to decode a binary 1 value (binary 0 value is AA== when base64-encoded):


answered 11 Sep '12, 09:46

wojciechka's gravatar image

wojciechka ♦♦
accept rate: 26%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 11 Sep '12, 09:31

Seen: 3,254 times

Last updated: 11 Sep '12, 09:46