📜 ⬆️ ⬇️

How to attach any file to a new Windows 7 taskbar

logo The new Windows 7 taskbar is not only different from the MacOS dock, but also with intelligence and wit. In particular, he is very offended when they want to attach (pin) to anything other than the .exe file: a script, a program in python. The logic of the developers is easy to understand: the new taskbar automatically puts the attached documents in the context menu of the programs. For example, if you drag a text document to the taskbar, then a notepad will be attached to the taskbar, and the document itself will be accessible by right-clicking from the 'pinned items' list. Unfortunately, this approach has two problems. First, you need to do a right click on the icon - too much movement, very inconvenient on notebook touchpads. Secondly, this method does not work for many types of files, for example - .bat files or python scripts. Googling, oddly enough, does not give a quick answer. Therefore, dear colleagues, I briefly outlined a sequence of steps that allows you to attach any file to the taskbar and change its icon.


Step one


We attach any program to the taskbar, for example - notepad:
source

Step Two


Push start and execute the shell:user pinned . In the opened folder, select “TaskBar” - in this hidden folder are shortcuts from the taskbar. Right click on the notepad shortcut, select the properties, the shortcut tab and in the target field in quotes enter the name of the file that we want to attach to the taskbar. For example, a .bat file. Now click on the notepad icon in the taskbar to open or run the selected file.
')

Step Three


To change the icon, also right-click on the shortcut notepad, properties, tab shortcut, click on the 'change icon' and set the desired icon. Unfortunately, the icon will change only for a shortcut in a hidden folder - the old folder will remain in the taskbar, because it has become cached. To update the cache, close all programs, run the task manager and kill the explorer process. Then, from the top task manager menu, select file, 'new task' and run cmd. We type the following commands:
attrib -h %userprofile%\AppData\Local\IconCache.db
del %userprofile%\AppData\Local\IconCache.db
After successful removal of the cache, we launch explorer through the same task manager. Voila - we have an icon in the taskbar that opens the file we need and looks like we need:
result

disadvantages


As already mentioned, this method is quite deep customization and was not originally intended by the creators of the new taskbar. Therefore, the resulting icon, although it will look like we want to run anything, will lose the ability to associate with the running application. Of course, if a script without a GUI is hung on it, then this is not a problem. But if the program is called upon execution, its icon will not be linked to ours and will be shown separately. If anyone knows how windows 7 associates icons in the taskbar and windows of running programs - share the secret :).

Source: https://habr.com/ru/post/79153/


All Articles