You can use a VBScript file like the following:
Const CSIDL_COMMON_PROGRAMS = &H17 Set objShell = CreateObject("Shell.Application") Set objAllUsersProgramsFolder = objShell.NameSpace(CSIDL_COMMON_PROGRAMS) strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path Set objFolder = objShell.Namespace(strAllUsersProgramsPath & "\Microsoft Office") Set objFolderItem = objFolder.ParseName("Microsoft Word 2010.lnk") Set colVerbs = objFolderItem.Verbs For Each objVerb in colVerbs If Replace(objVerb.name, "&", "") = "Pin to Taskbar" Then objVerb.DoIt Next
If you want to pin any arbitrary EXE to the taskbar, take a look at this article, download the attached code and call PinItem.vbs like this:
cscript PinItem.vbs /taskbar /item:"Drive:\Path\to\app.exe"