Michiel78 1 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? Share this post Link to post Share on other sites
Jos 2,208 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. Share this post Link to post Share on other sites
Michiel78 1 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 Share this post Link to post Share on other sites
Jos 2,208 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. Share this post Link to post Share on other sites
Michiel78 1 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 ! Share this post Link to post Share on other sites