What gets displayed if you place this:

?"ERROR @ERROR : @SERROR"

after the setfileattr() line ?

Access is denied ?

Something else ?

-Shawn