Also remember that arrays are 0 based, so this
 Code:
If Ubound($arrPatches,2) > 0
Should probably be
 Code:
If Ubound($arrPatches,2) >= 0
In case there is only 1 in the list.

Same goes for this
 Code:
For $intI = 1 to Ubound($arrPatches,2)
should probably be
 Code:
For $intI = 0 to Ubound($arrPatches,2)
Otherwise you will miss the first in the list, unless your getallpatches is padding the first element or something weird.