Jump to content

Recommended Posts

Posted

Hi

I use the following code in my script. But there is the possibility that a file is already open e.g. in Word

The strange thing is that FileOpen always returns ok even when the file ist opend in Word .....

Is the the possibility to open a file exclusivly ???

greetings mozart90

$file = FileOpen("c:\test.doc", 1)

If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileClose($file)
Posted

Hi

I use the following code in my script. But there is the possibility that a file is already open e.g. in Word

The strange thing is that FileOpen always returns ok even when the file ist opend in Word .....

Is the the possibility to open a file exclusivly ???

greetings mozart90

$file = FileOpen("c:\test.doc", 1)

If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileClose($file)

I noticed the same behavior. It seems that Word is not locking the file. In fact, I opened a file in Word and deleted it without Word complaining. However, if you open a file using autoit and then try to open the file in Word, you will get a message that it is in use. So, I think this isn't a problem with autoit.

Posted

Maybe try using a ProcessExists command to see if there is already one open before attempting to open it.

Posted

Did any of the solutions offered to you in your other thread on this topic work for you?

http://www.autoitscript.com/forum/index.ph...showtopic=22440

Hi,

sorry but none of the ideas are working because it is a computer with limited rights and to pipe the net file you need admin rights...

so I thought it's possible to get the desired information by trying this way (with fileopen)

greetings mozart90

Posted

Hi,

sorry but none of the ideas are working because it is a computer with limited rights and to pipe the net file you need admin rights...

so I thought it's possible to get the desired information by trying this way (with fileopen)

greetings mozart90

Compile the script in the other thread and then call that script via another script that uses RunAsSet. [2000/XP or later]

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted

Compile the script in the other thread and then call that script via another script that uses RunAsSet. [2000/XP or later]

... another good idea but the skript has to run on other computers on which I dont' have admin rights...

greets mozart90

Posted

I'm beginning to think that you cannot get there from here. You might have to look around for a third party tool.

[size="1"][font="Arial"].[u].[/u][/font][/size]

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
  • Recently Browsing   0 members

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