I have a simple script for checking registry entries on users' machines, and there's a bit of script that goes like:

;snip
? "checking keys"
$ReturnCode = EXISTKEY("Somekeyhere")
$ReturnCode
IF @ReturnCode = 0
? "KeyFound!"
;snip

The output is something like:
checkingkeys2
Keyfound

now surely the "2" after the message is the $ReturnCode value, which does not = 0, so why does the if statement execute?

please help, this is causing havoc with my scripts

Thanks,

Mark