Jump to content

How can I recycle folder contents with subfolders locked files?


Recommended Posts

what do u mean by locked files?

you could check out FilegetAtrib something like this

not tested but it checks the return of the filegetatrib and if it isnt jsut a normal file then it deletes it

$search = FileFindFirstFile(@TempDir & "\*.*")  
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf
While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
IF Not StringInStr(FileGetAttrib($file),"N") >= "1" Then
    FileDelete($file)
EndIf   
WEnd
FileClose($search)
Link to comment
Share on other sites

first you have to gather a list of files.

(there are some udf's for this in the forum but i dont remember a name now...)

Randallc made a nice list

Then you could try to unlock them or FileRecycle() them seperatly.

Files which are still locked will fail...

Edited by piccaso
CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
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...