Try having a look at these suggestions:
VBscript: http://www.msfn.org/board/topic/154143-command-to-pin-or-unpin-program-from-taskbar/?p=981454
Powershell: http://gallery.technet.microsoft.com/scriptcenter/b66434f1-4b3f-4a94-8dc3-e406eb30b750
I haven't tested them myself!