Jump to content

Recommended Posts

Posted

Hi,

I am trying to open file for read.

It is working on Win Xp but not on Win7/2008

What 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)!

Posted (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 by lsakizada

Be Green Now or Never (BGNN)!

Posted

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)!

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
×
×
  • Create New...