Here's one a little smaller (i hope).
It doesn't seen to find the file using the %Systemroot% variable.
Code:
Function TempArray($KBNumber)
Break on
$arrayfilehandle = FreeFileHandle()
$filename = "$ScriptDir\UpdateFileList\" + $KBNumber + ".csv"
If Open($arrayfilehandle,$filename) = 0
$line = ReadLine($arrayfilehandle)
While @error = 0
$array = Split($line,",")
$FileNameCheck = $array[0]
$FileVerCheck = $array[1]
If GetFileVersion($FileNameCheck,"FileVersion") < $FileVerCheck
? 'Error '+@ERROR+' - '+@SERROR
? "$FileNameCheck;$FileVerCheck"
Sleep(1)
$NeedUpdate = 'Y'
$TempArray = $NeedUpdate
EndIf
$line = ReadLine($arrayfilehandle)
Loop
$= Close($arrayfilehandle)
endif
EndFunction
Here's what the .csv file looks like.
%SystemRoot%\System32\Catsrv.dll,2000.2.3511.0
%SystemRoot%\System32\Catsrvut.dll,2000.2.3511.0
%SystemRoot%\System32\Clbcatex.dll,2000.2.3511.0
And here's some logging information:
Error 2 - The system cannot find the file specified.
%SystemRoot%\System32\Catsrv.dll;2000.2.3511.0
C:\WINNT\System32\Catsrv.dll
Error 2 - The system cannot find the file specified.
%SystemRoot%\System32\Catsrvut.dll;2000.2.3511.0
C:\WINNT\System32\Catsrvut.dll
Error 2 - The system cannot find the file specified.
%SystemRoot%\System32\Clbcatex.dll;2000.2.3511.0
C:\WINNT\System32\Clbcatex.dll