You shouldn't be deleting index.dat. That's not a cookie. Cookies are TXT files. You should be getting only the TXT files when you call GetFiles. Read the documentation for the method and it will show you how to filter the files. That said, an error deleting one file shouldn't stop any of the others being deleted.