Sign in to follow this  
Followers 0
ddk

Howto unlock all file on the dynamic folder

5 posts in this topic

Hi All,

for single file successed with

Local $handle = FileOpen("test.txt", 0)
FileClose($handle)

is there any way to unlock all file on the dynamic folder?

let's say the folder is "x:\apps\data\000xxx

the "xxx" is randomly number assign

So when the task script code copying new file, there is no error pop-up say "access denied/file in use" again.

Many thanks

Share this post


Link to post
Share on other sites



Are the files being locked by the AutoIt script process?


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Are the files being locked by the AutoIt script process?

No, the files are weekly data and will updating each week,

I run script at server side and the exe file execute by other users from server share folder.

Edited by ddk

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I got busy and then fell asleep, else I'd have posted this earlier.

Anyway, hopefully you know how to use AutoIt script because I'm not willing to gt too involved in exposing how to use it in great detail.

_UnlockFile("ProcessID - PID", "File path to unlock")

This should work with normal files that have a lock on them by another process, directories can also be unlcked.

"File path to unlock" can also be an array of path strings instead of just a path string.

Hope this helps.

File Unlocker.au3

The above script is basically a

Edited by CaptainClucks

Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites

Also, please be aware that unlocking files can sometimes cause the process that had a lock on the file to go berserk (in very rare cases though), usually when the application was badly written. Most apps will usually just recreate a log file and lock it again when they find out it's missing the handle to it. But on rare occasions, some just want show you who's boss by consuming all the CPU. This has only happened once before, and I can't remember what application it was either, I think it was some kind of task manager.


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

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