Sounds overly complicated, actually.

What are you trying to do, exactly? Verify that shortcuts for Word, Excel, etc actually exist?

If so, your If/Endif won't do the job.

Create a FLAG variable for each shortcut (I'll use Word & Excel in the example):
$fWord = 1 $fExcel = 1

Replace the whole If/EndIf with a Select statement:
 Code:
Select
 Case InStr($Path, 'Word.exe')        ; found - don't need to install
  $fWord = 0
 Case InStr($Path, 'Excel.exe')
  $fExcel = 0
EndSelect

; Should Word shortcut be defined
If $fWord
  ; copy/create the Word shortcut
EndIf

Place this after the Next statement, when everything else is done:
 Code:
; Should Excel shortcut be defined
If $fExcel
  ; copy/create the Excel shortcut
EndIf


Glenn


Edited by Glenn Barnas (2008-02-05 07:56 PM)
Edit Reason: typo in example
_________________________
Actually I am a Rocket Scientist! \:D