Not without seeing the EXACT code that was failing. It should work fine as long as you have the path correct and the rights to remove the file and that it's not currently locked.

Did you put in any @ERROR codes to see what was going wrong?