I agree with Richard. So what were agreeing to is that the UDF should remain as is (returning the errorlevel).