Sign in to follow this  
Followers 0
TomCat

force FileOpen possible?

5 posts in this topic

Hi I have following Problem. I need to write some text into a file that is opened by an other process.

If I try to write into the file like this:

$file = FileOpen("test.txt", 1)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileWrite($file, "Line1")
FileWrite($file, "Still Line1" & @CRLF)
FileWrite($file, "Line2")

FileClose($file)

I get error Unable to open file.

If I use iniwrite for same file i can write into the file.

How can i force FileOpen now to open it for write into the file even if other process is writing to it?

Or is their a way to unlock the other file with autoit?

I hope someone here can help me :mellow:

Share this post


Link to post
Share on other sites



http://msdn.microsoft.com/en-us/library/aa365715(VS.85).aspx

Not sure if that will work or not.

Share this post


Link to post
Share on other sites

Hi tnx for the answer but no doesnt work :mellow:

Any else ideas?

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

does not work too :-/ looks like only way is to use unlocker with commandline in a script.

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