Hi, I'm a software developer and from within an application, I'm trying to delete a directory tree. Sometimes this does not work and when it doesn't work, I finally found out that it's an invalid file handle error. At least that's what Icacls says.
I have tried many different ways to delete the directory structure, but none will work, but oddly enough, if you try to delete the directory tree outside of the application with windows explorer it will work fine. Even with the application up and running.
I've made sure that nothing in the application has a hold on any of the directories or files.
Does ANYONE know a command line to run to reset those attributes for a whole directory tree?
Ok... if anyone else runs into this, I was able to come up with something that made things work. Take a look at Icacls and the things it can do. Here are the commands that I ran in my application that might help someone. NOTE: AppPath + "\Output" and inPath are the same thing and they are both talking about a directory.