# win\_regedit error "Input string was not in a correct formatInput string was not in a correct format"

**URL:** <https://forum.ansible.com/t/win-regedit-error-input-string-was-not-in-a-correct-formatinput-string-was-not-in-a-correct-format/22109>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [July 25, 2016, 9:22am UTC](https://forum.ansible.com/t/win-regedit-error-input-string-was-not-in-a-correct-formatinput-string-was-not-in-a-correct-format/22109 "2016-07-25T09:22:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user86](https://avatars.discourse-cdn.com/v4/letter/u/2acd7d/32.png) [@user86](https://forum.ansible.com/u/user86)\
**Post date:** [July 25, 2016, 9:22am UTC](https://forum.ansible.com/t/win-regedit-error-input-string-was-not-in-a-correct-formatinput-string-was-not-in-a-correct-format/22109/1 "2016-07-25T09:22:57Z")

</div>

Hello.

I have a problem with win\_regedit.

My code:

`

- name: Windows Update.  
hosts: windows  
tasks:
- name: RebootRelaunchTimeout.  
win\_regedit:  
key: HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU  
value: RebootRelaunchTimeout  
data: 000005a0  
datatype: dword  
`

When error:

`TASK [RebootRelaunchTimeout.] ************************************************** task path: /etc/ansible/playbooks/WUset.yml:71 <ansible2008r2> ESTABLISH WINRM CONNECTION FOR USER: admin on PORT 5986 TO ansible2008r2 <ansible2012r2> ESTABLISH WINRM CONNECTION FOR USER: admin on PORT 5986 TO ansible2012r2 <ansible2008r2> EXEC Set-StrictMode -Version Latest (New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1469437877.68-199496534619062").FullName | Write-Host -Separator ''; <ansible2012r2> EXEC Set-StrictMode -Version Latest (New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1469437877.69-195428104380917").FullName | Write-Host -Separator ''; <ansible2008r2> PUT "/tmp/tmpjENPim" TO "C:\Users\admin\AppData\Local\Temp\ansible-tmp-1469437877.68-199496534619062\win_regedit.ps1" <ansible2012r2> PUT "/tmp/tmpo9luil" TO "C:\Users\admin\AppData\Local\Temp\ansible-tmp-1469437877.69-195428104380917\win_regedit.ps1" <ansible2008r2> EXEC Set-StrictMode -Version Latest Try { & "C:\Users\admin\AppData\Local\Temp\ansible-tmp-1469437877.68-199496534619062\win_regedit.ps1" } Catch { $_obj = @{ failed = $true } If ($_.Exception.GetType) { $_obj.Add('msg', $_.Exception.Message) } Else { $_obj.Add('msg', $_.ToString()) } If ($_.InvocationInfo.PositionMessage) { $_obj.Add('exception', $_.InvocationInfo.PositionMessage) } ElseIf ($_.ScriptStackTrace) { $_obj.Add('exception', $_.ScriptStackTrace) } Try { $_obj.Add('error_record', ($_ | ConvertTo-Json | ConvertFrom-Json)) } Catch { } Echo $_obj | ConvertTo-Json -Compress -Depth 99 Exit 1 } Finally { Remove-Item "C:\Users\admin\AppData\Local\Temp\ansible-tmp-1469437877.68-199496534619062" -Force -Recurse -ErrorAction SilentlyContinue } <ansible2012r2> EXEC Set-StrictMode -Version Latest Try { & "C:\Users\admin\AppData\Local\Temp\ansible-tmp-1469437877.69-195428104380917\win_regedit.ps1" } Catch { $_obj = @{ failed = $true } If ($_.Exception.GetType) { $_obj.Add('msg', $_.Exception.Message) } Else { $_obj.Add('msg', $_.ToString()) } If ($_.InvocationInfo.PositionMessage) { $_obj.Add('exception', $_.InvocationInfo.PositionMessage) } ElseIf ($_.ScriptStackTrace) { $_obj.Add('exception', $_.ScriptStackTrace) } Try { $_obj.Add('error_record', ($_ | ConvertTo-Json | ConvertFrom-Json)) } Catch { } Echo $_obj | ConvertTo-Json -Compress -Depth 99 Exit 1 } Finally { Remove-Item "C:\Users\admin\AppData\Local\Temp\ansible-tmp-1469437877.69-195428104380917" -Force -Recurse -ErrorAction SilentlyContinue } fatal: [ansible2008r2]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "win_regedit"}, "msg": "Cannot convert value \"000005a0\" to type \"System.UInt32\". Error: \"Input string was not in a correct format.\""} fatal: [ansible2012r2]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "win_regedit"}, "msg": "Cannot convert value \"000005a0\" to type \"System.UInt32\". Error: \"Input string was not in a correct format.\""}`

Can you help me? Thank you.

---

<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:** [July 26, 2016, 5:49am UTC](https://forum.ansible.com/t/win-regedit-error-input-string-was-not-in-a-correct-formatinput-string-was-not-in-a-correct-format/22109/2 "2016-07-26T05:49:51Z")

</div>

Which ansible version are you using?  
I recently fixed an error with handling change detection for dword type, so might be worth trying 2.1.1 RC5 if you can.

Jon

---

<div class="post-metadata">

**Author:** ![user86](https://avatars.discourse-cdn.com/v4/letter/u/2acd7d/32.png) [@user86](https://forum.ansible.com/u/user86)\
**Post date:** [July 28, 2016, 8:03am UTC](https://forum.ansible.com/t/win-regedit-error-input-string-was-not-in-a-correct-formatinput-string-was-not-in-a-correct-format/22109/3 "2016-07-28T08:03:23Z")

</div>

I’m sorry. I forgot to write a version of the program. Unfortunately I have installed version 2.0.0.2. Today I will try to install the new version.
