The value could be NULL. I think that using @error may be more sound.
code:
$RealTray=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" , "RealTray")
if @error = 0
DelValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","RealTray")
endif

_________________________
Home page: http://www.kixhelp.com/hb/