Jump to content

Read File From UNC folder


Recommended Posts

This is a script.

$in=FileOpen($cmdline[1],0)
MsgBox(0,'',$cmdline[1] &  @error )
$error = 0
while $error <> -1
    $line = FileReadLine($in)
    $error = @error
    MsgBox(0,'',$line &  $error )
WEnd

It reads some file line by line. Whe I start it from local drive, it works perfectly. But when file is on share, and i start script from File Manager like Total Commander or FAR Manager:

\\SERVER\Distr\START>1.au3 logon.log

its behaviour very strange: it opens file(first message box show "filename.ext0"), but reading is impossible($error in cycle always is 1).

I know that when cmd starts on share, it changes dir to %SYSTEM%, but in this case file shouldn't be open for reading....

so, is it normal, and how should i read file from shared folder?

Edited by Dirk Diggler
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...