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 $