# win\_regedit; binary data

**URL:** <https://forum.ansible.com/t/win-regedit-binary-data/20675>\
**Category:** Ansible Project\
**Created:** [February 25, 2016, 10:18am UTC](https://forum.ansible.com/t/win-regedit-binary-data/20675 "2016-02-25T10:18:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [February 25, 2016, 10:18am UTC](https://forum.ansible.com/t/win-regedit-binary-data/20675/1 "2016-02-25T10:18:29Z")

</div>

Hi,

Does anyone have an example of using win\_regedit to set binary data?

I have a hex encoded string from a reg export but so far not found a way to convert it to whatever powershell needs.

Many thanks,

Jon

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [February 25, 2016, 2:47pm UTC](https://forum.ansible.com/t/win-regedit-binary-data/20675/2 "2016-02-25T14:47:38Z")

</div>

To follow up, it appears you need to convert the incoming data to a byte array. I have some prototype code that can do this and will tidy up the code and create a pull request to add this when I get the chance. If anyone else hits this before the PR is available let me know and I’ll send you a modified version of win\_regedit.

All the best,

Jon

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [April 15, 2016, 7:43am UTC](https://forum.ansible.com/t/win-regedit-binary-data/20675/3 "2016-04-15T07:43:14Z")

</div>

It’s been a while, but as promised, pull request to fix working with binary registry data here:

[https://github.com/ansible/ansible-modules-extras/pull/2034](https://github.com/ansible/ansible-modules-extras/pull/2034)

Also integration tests added for win\_regedit here: [https://github.com/ansible/ansible/pull/15422](https://github.com/ansible/ansible/pull/15422)

I tested against Server 2008 R2 and Server 2012 R2 so if anyone has other windows versions they could test against, I’d be very grateful.

Many thanks,

Jon
