To pin the program on Windows 7 task-bar or Windows 8, 8.1 please start the program what you want to pin (attach) on windows 7 (8, 8.1) Taskbar!
Here in example the file manager Q-Dir. When the program run in windows 7, click on the windows-7 Taskbar on the Taskbar program button (with right mouse click) and select the option "Pin this program to taskbar". (... see Image-1 Arrow-1)
To unpin detach the program from Windows-7 taskbar use again the right click on the taskbar program button and select "Unpin this program from taskbar". (... see Image-2 Arrow-1) That is the pin solution for Windows-7!
If the program is already running, right-click the program's button on the taskbar (or drag the button toward the desktop) to open the program’s Jump List, and then click Pin this program to taskbar.
If the program isn't running, click Start, find the program’s icon, right-click the icon, and then click Pin to Taskbar.
You can also pin a program by dragging the program's shortcut from the desktop or Start menu to the taskbar. Additionally, if you drag the shortcut of a file, folder, or website to the taskbar, and the associated program isn't already pinned there, then that program is pinned to the taskbar and the item is pinned to the program’s Jump List. Info notes:
To remove a pinned program from the taskbar, open the program's Jump List, and then click Unpin this program from taskbar.
Folders and shortcuts to folders appear in the Windows Explorer Jump List when opened or pinned.
You can pin a program from the Start menu to the taskbar, but not from the taskbar to the Start menu.