Jump to content

No DirRemove untill script is closed


 Share

Recommended Posts

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

  • Developers

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

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
Link to comment
Share on other sites

  • Developers

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...