Here are the two functions I use. They are adapted from some vbscripts.

 Code:
; Detache un programme a la superbar
function unpintotaskbar($file)
        ; Decoupage file en dir + filename
        $filename = substr($file, instrrev($file, "\") + 1)
        $dirname  = substr($file, 1, instrrev($file, "\") - 1)
        ; Clic sur "Epingler ..."
        $objShell = CreateObject("Shell.Application")
        $objFolder = $objShell.Namespace($dirname)
        $objFolderItem = $objFolder.ParseName($filename)
        $colVerbs = $objFolderItem.Verbs
        For Each $objVerb in $colVerbs
                if Replace($objVerb.name, "&", "") = "Détacher de la barre des tâches"
                        $objVerb.DoIt
                endif
        Next
endfunction

; Attache un programme a la superbar
function pintotaskbar($file)
        ; Decoupage file en dir + filename
        $filename = substr($file, instrrev($file, "\") + 1)
        $dirname  = substr($file, 1, instrrev($file, "\") - 1)
        ; Clic sur "Epingler ..."
        $objShell = CreateObject("Shell.Application")
        $objFolder = $objShell.Namespace($dirname)
        $objFolderItem = $objFolder.ParseName($filename)
        $colVerbs = $objFolderItem.Verbs
        For Each $objVerb in $colVerbs
                if Replace($objVerb.name, "&", "") = "Épingler à la barre des tâches"
                        $objVerb.DoIt
                endif
        Next
endfunction


Of course, "Épingler à la barre des tâches" and "Détacher de la barre des tâches" are for french language.
The following function lists all verbs for a program, so you can easily find the correct one in your language :

 Code:
function listVerbs($file)
        ; Decoupage file en dir + filename
        $filename = substr($file, instrrev($file, "\") + 1)
        $dirname  = substr($file, 1, instrrev($file, "\") - 1)
        ; Clic sur "Epingler ..."
        $objShell = CreateObject("Shell.Application")
        $objFolder = $objShell.Namespace($dirname)
        $objFolderItem = $objFolder.ParseName($filename)
        $colVerbs = $objFolderItem.Verbs
        For Each $objVerb in $colVerbs
                ? $objVerb
        Next
endfunction


Hope this helps.


Edited by FabienDupont (2010-07-06 06:15 PM)