lsakizada Posted August 15, 2010 Share Posted August 15, 2010 Hi,I am trying to open file for read.It is working on Win Xp but not on Win7/2008What am I supposed to do?Here is my function. I am getting the error: "Error - Unable to open file:"Func RunProcedure($filename) $file = FileOpen($filename, 0) If $file = -1 Then C("Error - Unable to open file: " & $filename) _FileWriteLog(@ScriptDir & "\Search.log", "Error - Unable to open file: " & $filename) Else $counter = 0 While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop Parse($filename, $line, $pString, $counter + 1) $counter = $counter + 1 Sleep(5) WEnd FileClose($file) EndIf EndFunc ;==>RunProcedure Be Green Now or Never (BGNN)! Link to comment Share on other sites More sharing options...
JohnOne Posted August 15, 2010 Share Posted August 15, 2010 Perhaps you dont have permission to open the file. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
lsakizada Posted August 15, 2010 Author Share Posted August 15, 2010 (edited) Perhaps you dont have permission to open the file.I have administrator rights on all machines.Same files are failing to be opened.Any idea how to compare rights? Edited August 15, 2010 by lsakizada Be Green Now or Never (BGNN)! Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 15, 2010 Share Posted August 15, 2010 Are you running the script "as admin"? Link to comment Share on other sites More sharing options...
lsakizada Posted August 15, 2010 Author Share Posted August 15, 2010 Are you running the script "as admin"?Well I just noticed that I may have a lock on the file and this is not an Admin issue.I probably need to figure out how to unlock the file.. Be Green Now or Never (BGNN)! Link to comment Share on other sites More sharing options...
JohnOne Posted August 15, 2010 Share Posted August 15, 2010 It stands to reason that if you locked the file in some fashion then you ought to know how to unlock it, if not then you do not have permission to open the file. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 16, 2010 Share Posted August 16, 2010 If the file is locked that means another application is currently using it. 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