As in your recommendation I changed the code to:

Code:

SetOption ('Explicit','ON')
SetOption ('NoVarsInStrings','ON')
SetOption ('CaseSensitivity','ON')
Global $UserArray[100]
Dim $UserDir, $User, $Computer, $RunCount
$RunCount = 0

$UserDir = Dir ('C:\Documents and Settings')
While $UserDir <> '' AND @ERROR = 0
$User = Left ($UserDir,2)
If $User = 'NL'
$Computer = Left ($UserDir,4)
If $Computer <> 'NLZZ'
$UserArray[$RunCount] = $UserDir
$RunCount = $RunCount + 1
EndIf
EndIf
$UserDir = Dir()
Loop

ReDim PRESERVE $UserArray[$RunCount-1]



Still the same error. Any other suggestion?

_________________________
-------------------------------------------------------------- With kind regards, GyroTwister