So i have a vb script that sweeps through RAP (Run advertised programs) and if the program has no last run time, but that program's full name into an array, then i have this array echo to a message box. I intialize the array to store 10 values, however to keep the message box clean i wanted to ReDim the array size once it had found all the programs (shoudn't ever be more than 3 but who knows with clients). However i can't seem to get the array to resize and it prints a message box with 10 array slots + the program it found.
Dim vprglist(10)
Dim i
Dim strBuf
Dim intIndex
Set vprograms = oUIResource.GetAvailableApplications
i = 0
For Each vprogram In vprograms
If vprogram.LastRunTime = "" Then
vprglist(i) = vprogram.FullName
i = i + 1
End If
Next
ReDim Preserve vprglist(i)
If vprglist <> Null Then
For intIndex = LBound(vprglist) To UBound(vprglist)
strBuf = strBuf & " - " & vprglist(intIndex) & vbLf
Next
vmsgbox = MsgBox("Do you want to Install(Yes) or Defer(No) the follow software: " & vbLf & strBuf,64+4)
Select Case vmsgbox