You didn't close the EXISTKEY command, also KEYEXIST has replaced EXISTKEY and should not be used anymore.
Try this:
code:
if KeyExist('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run','RealTRay')
$retcode=DelValue('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run','RealTray')
endif

Oh, and if that still doesn't work, then check the permissions on the registry key. By default, changes to the HKEY_LOCAL_MACHINE registry area require administrative privileges. You should also check the HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run registry keys

[ 04 April 2002, 19:41: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.