|
I've started trying to use the readfile() function:-
Function ReadFile($file) Dim $lf, $f, $_, $t $lf=chr(10) $f=freefilehandle $_=open($f,$file) if @error exit @error endif do $t=$t+readline($f)+$lf until @error $_=close($f) $ReadFile=split(substr($t,2),$lf) EndFunction
I read a text file containing the computer names ok, which I check by displaying the contents of the array, the problem is that I can't seem to assign the value in the array to another variable that is used to query the registry of the required computer. The commented out line is what doesn't work, the line below it works, and is the same computer name as what is in the array.
What am I doing wrong?
$array=readfile('machines.txt') ? $array[0] ; $System = trim($array[0]) $System = '\\NTW0346530\'
This is the sort of thing I'm using the $System for:-
$Key = $System + 'HKLM\SOFTWARE\Network Associates\ePolicy Orchestrator\Application Plugins\EPOAGENT3000' $ePO2 = ReadValue($Key, 'Version')
thanks
|