Les,

I have tried to run it in DEBUG but I don't see where it is going wrong.

Ok, your question

Als antwoord op:

If I had an inkling of what you are trying to do, I might make some suggestions but I am at a loss.




I'm (trying to) read(ing) all the subdirectories from \\OldMachine\C$\Documents and Settings.

In this directory I will find useraccount starting with 'nl' and computeraccounts starting with 'nlzz'. There both followed by a six digit number to be complete.

So if I read the subdir the only names I want to have in my array are names starting with nl<digit><digit> and NOT starting with nlzz.

After the other remarks you made i have rewritten the code. Maybe with this explanation you'll get the picture.

Code:

SetOption ('Explicit','ON')
SetOption ('NoVarsInStrings','ON')
SetOption ('CaseSensitivity','ON')
Dim $UserDir, $User, $Computer, $RunCount
Global $UserArray[100]
$UserDir = Dir ('O:\Documents and Settings')
While $UserDir <> '' AND @ERROR = 0
$User = Left ($UserDir,2)
$Computer = Left ($UserDir,4)
If $User = 'NL' AND $Computer <> 'NLZZ'
$UserArray[$RunCount] = $UserDir
$RunCount = $RunCount + 1
? $UserDir
Get $x
EndIf
$UserDir = Dir()
Loop

ReDim PRESERVE $UserArray[$RunCount-1]



I hope to hear from you!!!

t.i..a
_________________________
-------------------------------------------------------------- With kind regards, GyroTwister