I know the add/remove script was a proof of concept, but it was bugging me that 
some of the programs wouldn't remove properly. So this code for the button 
clicked fixes the problem of programs using the msiexec program in the 
\system32 directory. Since there was no absolute path specified in the 
registry, the script wasn't properly executing the correct uninstaller. This 
block fixes that and also parses out parameters, required for msiexec.
GW, feel free to incorporate this into the main script if you wish.

I can also attach the updated complete script if that's prefered.


   If dEvent = buttonClicked Then
    Dim shellObj : Set shellObj = CreateObject("Shell.Application")
    dim filename: filename = 
myApps.Item(dObj.Control("lst_programs").Text(dObj.Control("lst_programs").SelectedItem))
    if not instr(filename, "\") then
     Dim shell2Obj : set shell2Obj = CreateObject("WScript.Shell")
     Dim windir : windir = shell2Obj.ExpandEnvironmentStrings("%windir%")
     filename = windir & "\system32\" & filename
     Set shell2Obj = Nothing
    end if
    Dim parms, pos
    pos = instr(filename, " ")
    If pos > 0 then
     parms = mid(filename, pos+1, 999)
     filename = mid(filename, 1, pos-1)
    End if
    shellObj.ShellExecute filename, parms, "", "open", 1
    Set shellObj = Nothing
    dObj.Close
    DialogProc = True
    Exit Function
   End If

J.J. Meddaugh - ATGuys.com
A premier Licensed Code Factory and KNFB Reader distributor

Reply via email to