So back to the original subject..

My solution based on kdyer and r2d2's suggestions, and my circumstances, is:

IF EXIST ("test.txt")
SETFILEATTR ("test.txt",128)
DEL "test.txt"
ENDIF

Which looks like the easiest way to do what I need to do.

Set the file attributes to normal, so the DEL command can delete it with ease. (the file I'm deleting has attributes that vary from system to system. There is no need to know the attributes of the file, hence no GETFILEATTR command)

Thanks all.