Windows 8 and Windows 10 lets you pin folders to the Start screen, but pinning data files and folders to the taskbar is not allowed. The context menu entry Pin to Taskbar never exists for data files and folders. However, here is a neat little trick that lets you pin any file or folder (directory) to the taskbar.
Pin Any File or Folder to the Taskbar
- First, configure Windows to show the extension of known file types. To do so, open File Explorer, click File menu and select Change folder and search options. In the Folder Options dialog, select the View tab, and uncheck Hide extensions for known file types setting if it’s already enabled.
- Change the extension (to .exe) of the data file you want to pin to taskbar. Let’s say you have a text file named Notes.txt. Rename that to Notes.exe. You’ll see the following message when renaming the file. Click Yes when you see the prompt “Are you sure you want to change it?”.
- Right-click on the file
Notes.exeand choose Pin to Taskbar.
- Then change the extension of the file back to original (.txt). Alternately, you can right-click on an empty area on the folder where the file resides, and click Undo Rename option.
- Press and hold the Shift key, and right-click on the pinned icon on the taskbar and click Properties.
- In the Properties dialog that opens, change the file extension in the shortcut’s Target field, so that it points to the original file (Notes.txt).
- Additionally, make sure you customize the icon as it’s showing an unknown or generic icon right now. To set the correct icon, click Change icon and select an icon from the list. If you don’t like the stock icons from
imageres.dllor browse to locate the related application to pick suitable icon.
- Once done, click OK and OK to close the dialogs.
The taskbar icon won’t be refreshed unless you restart the explorer shell, or sign out of your user account and sign back in.
However, one downside of this method is that when you click on the pinned taskbar item, a new icon for the executable will show up on the taskbar and there is nothing that can be done about it.
The same method can be used to pin any folder. To pin folders, another option would be to create a folder shortcut with explorer.exe prefix. But everytime you click on it, it spawns a new explorer.exe process that doesn’t exit when the folder is closed. Whereas the above method won’t create extra explorer.exe instances.
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and has a vast experience in Windows — delivering support for Microsoft's consumer products. He has been a Microsoft MVP (2003-2012) who contributes to various Windows support forums.