At the line where the ExecuteProgram is comment the line so it doesn't run, and place the following lines right above it...

 Code:
? "Fullnameprg:  " + $fullnameprog
? " packidprog:  " + $packidprog
;$test = $oUIResource.ExecuteProgram ($fullnameprog,$packidprog)


Do these values look right? If not, its possible the error is higher in the script.