Michiel78 Posted November 14, 2010 Share Posted November 14, 2010 In my script I want to use the function DirRemove, to remove a couple of subdirectories. All files in the subdirectories have first been moved to óne folder. The problem is that the script will not remove the directories untill you've closed it. When the script is still running you also cannot manually enter or delete the directories, because Windows says that the location doesn't exist. I guess the script can't delete the directories because they are still in use, but I can't explain why, since the function that interacts with them has already ended before DirRemove is called. Does anyone perhaps know how to have the directories removed while the script is still running? Link to comment Share on other sites More sharing options...
Developers Jos Posted November 14, 2010 Developers Share Posted November 14, 2010 You are sure that all Files you used in any of the directories are properly closed before the DirRemove()? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Michiel78 Posted November 14, 2010 Author Share Posted November 14, 2010 (edited) Yes I'm sure about that, but I now wonder if it's perhaps possible that it has something to do with Windows admin rights or fileprotection? As far as I know none of those folders are protected, but I'll turn the whole fileprotection temporary off to see if it makes any difference. Edited November 14, 2010 by Michiel78 Link to comment Share on other sites More sharing options...
Developers Jos Posted November 14, 2010 Developers Share Posted November 14, 2010 Reason for asking about the fileclose() is that a common mistake is that people specify the filename in stead of the FileHandle returned by FileOpen(). This means that the file remains open until the script ends. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Michiel78 Posted November 14, 2010 Author Share Posted November 14, 2010 Turning off the entire fileprotection worked, I'll figure out later why this protection was even protecting the scriptfolder. For now everything is working, so this one's solved! Thanks for your help anyway Jos ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now