User1234 - Please use code tags around your code - it's difficult to read without them. Use the Code button if you're using the full screen editor, or simply place
 Code:
[CODE] and [\CODE]
around your code. Note that you need a forward slash - /CODE, but I can't display that here.

Also - GOTO has been long deprecated, despite the simple examples in the user manual. Using While/Loop is recommended, something like:
 Code:
$package=ENUMKEY($uninstallkey, $Index)  ; get the FIRST index value
While Not @ERROR
  do stuff...
  $Index = $Index + 1
  $package=ENUMKEY($uninstallkey, $Index)  ; must do this at the end also to get the NEXT index value
Loop
Basically, you get the loop control value before entering the loop, do stuff in the loop, and then repeat the line of code to get the control value again just before the loop ends. In this case, the ERROR macro is set before entering the loop, and again at the end, just prior to the loop starting again. When ERROR is set, the loop is not run and the process continues after the Loop statement.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D