Hello, KiX community,
I am still trying to get the software installed and the data copied in a way that I want. But I stumbled upon this; hereafter you'll see a snippet of code to determine which users reside on an old machine.
Code:
; ----- Which users reside on the old machine --------------------------------------------------
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 = 'NP'
$Computer = Left ($UserDir,4)
If $Computer = 'NLZZ'
GoTo Continue
Else
$UserArray[$RunCount] = $UserDir
$RunCount = $RunCount + 1
EndIf
EndIf
:Continue
$UserDir = Dir()
Loop
ReDim PRESERVE $UserArray[$RunCount-1]
For your information every user has a name starting with NP and followed by a 6 digit employee no.
All the computernames are starting with NLZZ and followed by there serial no which is read from the BIOS.
Everytime I run this script I get an error message:
ERROR: array reference out of bounds!
Does anyone see what I don't?
t.i.a.
_________________________
--------------------------------------------------------------
With kind regards,
GyroTwister