mozart90 Posted June 3, 2006 Share Posted June 3, 2006 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) Easy Zip Compression using XP Link to comment Share on other sites More sharing options...
JMiller Posted June 4, 2006 Share Posted June 4, 2006 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. Link to comment Share on other sites More sharing options...
Nomad Posted June 4, 2006 Share Posted June 4, 2006 Maybe try using a ProcessExists command to see if there is already one open before attempting to open it. Link to comment Share on other sites More sharing options...
mozart90 Posted June 5, 2006 Author Share Posted June 5, 2006 Maybe try using a ProcessExists command to see if there is already one open before attempting to open it.Hi this would be a nice idea if the files wouldn't be stored on a server ... any other suggestions ?greetings mozart90 Easy Zip Compression using XP Link to comment Share on other sites More sharing options...
herewasplato Posted June 5, 2006 Share Posted June 5, 2006 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 [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
mozart90 Posted June 6, 2006 Author Share Posted June 6, 2006 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=22440Hi,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 Easy Zip Compression using XP Link to comment Share on other sites More sharing options...
herewasplato Posted June 6, 2006 Share Posted June 6, 2006 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 mozart90Compile 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] Link to comment Share on other sites More sharing options...
mozart90 Posted June 6, 2006 Author Share Posted June 6, 2006 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 Easy Zip Compression using XP Link to comment Share on other sites More sharing options...
herewasplato Posted June 6, 2006 Share Posted June 6, 2006 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] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now