Try this and let me know your results...
 Code:
break on
;test for X64
If @onwow64=1
 $ = SetOption("WrapAtEOL","ON")
 $ = SetOption("WOW64AlternateRegView","on") 
 Dim $E,$T,$UN,$SK,$V
 $UN="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
 $SK='{Test-Data}'
 $V='DisplayName'

 ? "Writing REG_SZ value 'Testing' as test data to:"
 ? $UN+$SK+','+$V
 $E=writevalue($un+$SK,$V,'Testing','REG_SZ')
 ? 'Write Returncode='+$E+' '+@serror+@crlf

 $T=readvalue($un+$SK,$V)
 $E=@error
 ? 'Reading back value from registry = '+$T
 ? 'Read Returnerror='+$E+' '+@serror+@crlf

? 'Use REGEDIT to locate '+$SK
? 'Now press any key to continue...'+@crlf
Get $

$UN2=join(split($UN,'Microsoft'),'Wow6432Node')
? 'Manually searched the registry...'
? 'Actual registry path being used turned out to be:'+@crlf+$UN2+@crlf


$E=deltree($un+$SK)
? 'Deleting:'+$UN+$SK+@crlf+'Returned:'+$E+' '+@serror+@crlf

$E=deltree($un2+$SK)
? 'Deleting:'+$UN2+$SK+@crlf+'Returned:'+$E+' '+@serror+@crlf

? "Deleting 'Microsoft' key removed the 'Wow6432Node' key !"+@crlf

Else
 ? 'Not a x64 Test machine !'
Endif
? 'Press any key to exit...'
get $


Your code hilighted MY problem...
Because x64 the update test for KIX had not installed 4.6 onto the x64 machines so still only 4.53 therefore self defeating issue as no SetOption("WOW64AlternateRegView","on") in older version!
Manually updated to 4.6 and now I get the desired results.
Looks like the first test I need do is the KIX version!

Thanks for the help :-)



Edited by MACE (2009-11-11 10:45 PM)