in reply to Searching for a file, confirming that it exists, then deleting it

A couple of tricks might be helpful with your application. As a general note, your code is highly cluttered and confusing, which is going to make it hard to maintain. Some effort spent organizing and reducing it would probably help appreciably.