# extract remote windows registry value

**URL:** <https://forum.ansible.com/t/extract-remote-windows-registry-value/25460>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [September 12, 2017, 2:28pm UTC](https://forum.ansible.com/t/extract-remote-windows-registry-value/25460 "2017-09-12T14:28:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![misha](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@misha](https://forum.ansible.com/u/misha)\
**Post date:** [September 12, 2017, 2:28pm UTC](https://forum.ansible.com/t/extract-remote-windows-registry-value/25460/1 "2017-09-12T14:28:38Z")

</div>

Hi,  
I’m using the playbook to extract registry key of a product using [win\_reg\_stat](http://docs.ansible.com/ansible/latest/win_reg_stat_module.html)[module](http://docs.ansible.com/ansible/latest/win_reg_stat_module.html)

`

- name: check product installed  
hosts: windows  
tasks:

- name: phase one  
win\_reg\_stat:  
path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{5ADDC865-7641-4CFB-BD89-6BE1709BD503}  
name: DisplayVersion  
register: LGV

- name: phase two  
debug:  
var: LGV.exists

`

However the debug output is ““LGV.exists”: “VARIABLE IS NOT DEFINED!””  
Any idea what I’m missing here? (my ansible version is ansible 2.3.1.0)

I need to extract in shell a 0 (false) or true (1) after this playbook execution. Thank you!
