Jump to content

Can not open file for read on win7 and 2008R2


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

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