There is no real problem with his code, very un-tidy but the problem is due to him trying to use the del command when trying to delete folders.

But the IF ELSE and ENDIF will work without putting anything in to the first IF statement, messy but will work. The full path is comming from DirPlus.