You're missing the element mumber in your array calls in line
code:
WriteLine (9, $UtilPath + "\XCACLS.EXE " + $InputArray + " /C /E /G " + $InputArray + ":" + $InputArray + ";" + $InputArray + Chr(13) + Chr(10))

. I think you want to accomplish something like this:
code:

WriteLine (9, $UtilPath + "\XCACLS.EXE " + $InputArray[0] + " /C /E /G " + $InputArray[1] + ":" + $InputArray[2] + ";" + $InputArray[3] + Chr(13) + Chr(10))


Another example:
code:

$a='aaa,bbb,ccc'
$b=split($a,',')
? $b[0]
? $b[1]
? $b[2]
? $b


The first three outputs are correct, the last one trying to output the complete array will result in the error code you described.
_________________________
There are two types of vessels, submarines and targets.