Jump to content

Folder lock after script run


SSJoco
 Share

Recommended Posts

Hi!

I have a little Autoit script (1200 lines). This script scan files and folders, then copy some files or start WinRAR. That's all!

However after the scan and copy, all the source folders is locked. I have to close the script then delete the folder. It means the script still user this folders. I search every possible command which is use direcory, but nothing. I use FileFindFirstFile command which request Fileclose operation and I have every close commands.

Any idea how can I find whick command lock the dir?

Link to comment
Share on other sites

Hi!

I have a little Autoit script (1200 lines). This script scan files and folders, then copy some files or start WinRAR. That's all!

However after the scan and copy, all the source folders is locked. I have to close the script then delete the folder. It means the script still user this folders. I search every possible command which is use direcory, but nothing. I use FileFindFirstFile command which request Fileclose operation and I have every close commands.

Any idea how can I find whick command lock the dir?

Same problem when you use it compiled ?

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

It locks the folder both au3 and exe as well.

I attached the whole script.

winrar4ever() function do the main job. Lock every folder which contains *.rar file until I do not close the program. I do the same thinh with *.avi, *.nfo files, only I copy them, but it do not lock the folders.

I use _Filelisttoarray only in the rar search, because I have found this command recently.

WinRAR4ever.au3

Link to comment
Share on other sites

  • Developers

Had a quick glance at your code and saw at least one instance where you do not properly close a filehandle:

$searchsample = FileFindFirstFile("*sample*.*")
            If $searchsample = -1 And FileExists($source & "\" & $rar[$b] & "\Sample") Then
                FileChangeDir($source & "\" & $rar[$b] & "\Sample")
                $searchsample = FileFindFirstFile("*.*")
            EndIf

You want to FileClose($searchsample ) before doing another FileFindFirst().

Jos

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

I think I've got it!

I do FileFindFirstFile inside the loop, but I closed the handler after the loop. If I close the search handler at the end of the loop then it won't lock the folders.

Uh, I haven't edited this program for a while.

Thanks For The Help

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...