Glenn,

i agree that it is a very bad idea to use readprofilestring with a network file. This is why I first copy network file to a local temp file and use the local file.

i have made a test of performance with your functions and with ReadProfileString on local files of several size. Here is my code :
 Code:
break on

dim $inifile, $tmpfile, $ini, $arrSections, $arrKeys, $section, $key, $d1, $d2

$arrInifiles =
  @scriptdir+"\test\file000.ini",
  @scriptdir+"\test\file001.ini",
  @scriptdir+"\test\file002.ini",
  @scriptdir+"\test\file003.ini",
  @scriptdir+"\test\file004.ini",
  @scriptdir+"\test\file005.ini",
  @scriptdir+"\test\file006.ini",
  ""

right( "        size",8 )
right( "        time1",8 )
right( "        time2",8 )
"  filename"
?
for each $inifile in $arrInifiles
  if $inifile
    $tmpfile = @scriptdir+"\"+@ScriptName+".tmp"
    COPY $inifile $tmpfile

    $size = GetFileSize($tmpfile)

    ;-- read with ini functions --
    $start = @TICKS
    $ini = IniArray( $tmpfile )
    $arrSections = IniSections($ini)
    for each $section in $arrSections
      $arrKeys = IniKeys( $ini, $section )
      for each $key in $arrKeys
        $value = ReadIniArray( $ini, $section, $key )
      next
    next
    $d1 = @TICKS - $start

    ;-- read with ReadProfileString --
    $start = @TICKS
    $arrSections = ReadProfileString( $tmpfile, "", "" )
    $arrSections = split($arrSections, chr(10) )
    for each $section in $arrSections
      if $section
        $arrKeys = ReadProfileString( $tmpfile, $section, "" )
        $arrKeys = split($arrKeys, chr(10) )
        for each $key in $arrKeys
          if $key
            $value = ReadProfileString( $tmpfile, $section, $key )
          endif
        next
      endif
    next
    $d2 = @TICKS - $start

    right( "        "+$size,8 )
    right( "        "+$d1,8 )
    right( "        "+$d2,8 )
    "  "
    $inifile
    ?

    DEL $tmpfile
  endif
next

;-- insert your ini functions here

I have been very surprised because on my workstation, code with ReadProfileString is always faster (Windows XP SP3 and never constated problem of file size) !!!
 Code:
    size   time1   time2  filename
      91       0       0  .\test\file000.ini
    2019       0       0  .\test\file001.ini
    7553      47      15  .\test\file002.ini
   34527     485      47  .\test\file003.ini
   69058    1078     140  .\test\file004.ini
  103587    1844     219  .\test\file005.ini
  138116    2735     344  .\test\file006.ini

First, i copy the ini file in a temp file. so, ini file is the local cache disk.
I think the difference of speed is due to many calls to functions with array that can be large. As variables are passed by value, each call duplicates the array in memory. With large ini file this can be much slower than call to ReadProfileString.

One of the first steps of my login script is to do a robocopy from \\netlogon to a local temp directory. Next, all scripts are executed from local directory.

We have the same login script for about 6000 users. At the first connection, the netlogon is copied locally. At the following connection, a new robocopy copies only changed files (not often). This is fast and efficient, specially for WAN workstations.

I will make other tests tomorrow at the office on several types of workstations to see if results are reproductible...

Now, it's time to sleep in France ;\)
_________________________
Christophe