>I used the term empty in my post loosley. If the registry key is not there, it does return a .NULL. String. I step through the code in the debugger and do get into that IF, so I know that part works. It just doesn't seem to return any vals. The program will exit, but I can't grab that error code.
I used following batch file for testing if return code is what I expected. You've to run it from Command promp otherwise you wouldn't see result.
@echo off
h:\temp\test.exe
if errorlevel 257 goto other
if errorlevel 256 goto l256
:other
echo Other RC
goto end
:l256
echo RC=256
:end
--sb--