Sign in to follow this  
Followers 0
Michiel78

No DirRemove untill script is closed

5 posts in this topic

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



You are sure that all Files you used in any of the directories are properly closed before the DirRemove()?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Michiel78

Share this post


Link to post
Share on other sites

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.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 :graduated:!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0