Why can’t I pin a document to the taskbar?


Sven2 wonders why the taskbar won't let you pin a batch file or a shortcut to a log file.

The idea behind pinning an item to the taskbar is that it represents something that isn't running on the taskbar right now, but when you click the pinned item, it turns into a real item in the taskbar.

And items on the taskbar are identified by their application user model ID. We saw earlier how you can set a custom application user model ID on your window to make it group differently. Perhaps because you have two executables that work together and you want them to be treated as one giant logical application. Or perhaps because you have one executable that represents multiple logical applications.

Okay, now we're getting closer to the issue.

Batch files and documents are not logical applications. They are things that get opened by applications. Batch files, for example, are opened by the cmd.exe application. When you open two command prompts, the two command prompt windows are grouped together. If you run a batch file in one of the command prompts, the command prompt does not unsplit from its sibling and become a separate group. It's still the "command prompt" application; it's just doing something different right now.

Similarly, if you have two Notepad windows open, and then you tell one of them to open a log file, it does not unsplit from its sibling to become "The log file application".

Suppose that you could pin batch files and log files to the taskbar. How should they group with other command prompts and Notepads? (In other words, what would the application user model ID for the pinned item be?)

If the pinned batch file has its own application user model ID, then when you clicked the pinned item and the batch file ran, the resulting batch file window would not be grouped with the icon on the taskbar, the resulting batch file window is running with cmd.exe's application user model ID. You would have two icons for the batch file: A ghost that represents a launcher for the batch file, and then the actual batch file.

On the other hand, if the pinned batch file used cmd.exe's application user model ID, then all command prompts would get grouped together with your batch file icon, since your batch file icon says "I am cmd.exe!"

It sounds like what you really want is a quick way to launch a batch file. And we already have that. it's called Quick Launch.

Comments (33)
  1. Juan says:

    It seems like trying to get the cube go through the star shaped hole in the shapebox. If you really want to do that you will just end by having another cube shape in the shapebox if this comment makes any sense.

  2. BZ says:

    Wait, wasn’t QuickLaunch retired in the same version of Windows that pinning to the taskbar was introduced (Windows 7)?

    1. Ray Koopa says:

      Yeah, unless Quick Launch is again one of those terms of the taskbar which are not what people think (I’m looking at you, tray). I think he meant jumplists?

      1. Medinoc says:

        The QuickLaunch toolbar itself was retired, but you can create one yourself by putting your shortcuts in a directory and using the “New toolbar…” command from the taskbar’s context menu.

        1. Juan says:

          The Quicklaunch folder for the toolbar it’s still there at: %appdata%\Microsoft\Internet Explorer\Quick Launch

          1. Kirby FC says:

            Yes, Quick Launch is still there but it has been turned off by default since Windows Vista. Just right click on the taskbar, select “New Toolbar” and paste in ” %appdata%\Microsoft\Internet Explorer\Quick Launch”.

          2. Ray Koopa says:

            @Kirby FC: Since 7*, in favor of the new super bar. Anyway, the reason it doesn’t appear in the right click menu by default anymore tells me someone wants it dead.

          3. MarcK4096 says:

            The taskbar toolbar icons also don’t render vertically centered like the notification area icons do. That’s another hint that the feature has some detractors. However, I don’t think Quick Launch is a good substitute for pinning. One big advantage of pinned programs is that when you start it, it doesn’t create a second taskbar icon like starting something from Quick Launch does.

    2. Azarien says:

      Quick Launch is still there and almost works in Windows 10.
      “almost”, because Win+digit key shortcuts no longer quick launch an application, but select a button from taskbar instead.

  3. DWalker says:

    Well, I always turn grouping off anyway, because grouping hides information from the user. I use “Never Combine”. All of this effort to worry about how to group things seems (to me) like a waste of time….

    Just because two documents are opened with Word does not mean that they are any more “related” and should be “collapsed” into one entry, than one Word document and one Excel document would be. Each document is a container of information, and should stand on its own.

    I want to see the NAME of the item that I am working with; the name of the program that is used to open the documents (containers) is not important.

    “It sounds like what you really want is a quick way to launch a batch file. And we already have that. it’s called Quick Launch.”. I thought QuickLaunch went away after Windows 7. However, in Windows 7 (and maybe 10?) a toolbar that has “Show Text” and “Show Title” turned off looks very much like a QuickLaunch toolbar, and I have one of those near the Start button (as God intended). Looks great with a two-row-high taskbar.

  4. Pierre B. says:

    You’re leaking a low-level implementation. End-users have no concept of app ID. They have icons they can click on on the task bar. The task bar groups some together, but for the user, it’s just magic.

    Now, for a solution, it’s just to make the task bar do what the user expect. (Assuming the original request is a widespread desire and end-user expectation.)

    If a log file or batch file is pinned on the task bar, have the task bar record the process ID of the lauched app and for that particular process, ignore the app ID and just associate it withthe log/batch file in the task bar. Bingo!

    1. And then the user uses that same Notepad to open some other file and then… what? Or the user right-clicks that Notepad to see the jump list and then… what?

      1. alegr1 says:

        It looks like Windows doesn’t use the application ID to open a pinned file, though. For example, if you have different versions of Office installed, and click on a file pinned to a icon of older Excel, the file will be opened in the newer Excel.

  5. Ray Koopa says:

    You can still create a shortcut to CMD, pass it the batch file as an argument, an pin it as a separate item. That also keeps CMD running in the additionally pinned button.

  6. smf says:

    >Suppose that you could pin batch files and log files to the taskbar. How should they group with other command prompts and >Notepads? (In other words, what would the application user model ID for the pinned item be?)

    Secret option C, the shortcut/document would have it’s own application user model ID which would override the applications.

    You might not be able to justify the budget, but that is how I would want it to work.

    1. So if you open Contoso.log in Notepad, it gets its own application user model ID, which means its own jump list and other stuff. (Of course, that jump list will look pretty empty.) And then you use that same Notepad to open some other file. What happens? Does its application user model ID stay “Notepad.Contoso.log” or does it change to “Notepad”? What if you open Notepad first, and then open Contoso.log. Does that Notepad change its application user model ID to “Notepad.Contoso.log” so it unsplits from the other Notepads? How would you teach Notepad about all the custom application user model IDs that have been created? Is D:\Contoso.log the same as C:\Contoso.log?

      1. Joshua says:

        @DWalker: I on the other hand leave so many applications running (on 32 bit Windows!) that I now utterly depend on the collapsing ability.

        @Raymond: If we extend logically, if you clicked on a pinned data file it would launch the associated application, but the application would not group with the pinned data file.

        As far as I can tell people want the pinned icons to be the new quick launch.

      2. Kirby FC says:

        You’re looking at things through “developer colored glasses”.

        The user has no idea about “application user model ID”, and shouldn’t have to.

        1. Yes, I know. The problem is that managing document identity is not tractable in general because programs do not usually notify the shell when they close a document or open a new one.

        2. AndyCadley says:

          Apple attempted to unify the idea with the Dock and despite numerous revisions have never quite avoided some of the “weird” that happens as a result of it. And that’s despite the Mac’s “everything is MDI” type of application model.

      3. skSdnW says:

        The jump list is application specific but the taskbar grouping should not be. Contoso.log has nothing to do with Microsoft.txt and they should not be grouped together just because they are both open in Notepad! The worst part of this is that Win7 gave you a couple of taskbar settings but none of them fully return the taskbar to the way it worked by default in Win95-2000 and after a settings change in XP-Vista. That is 20 years of doing things one way and then forcing everyone to change their workflow.

        I want the taskbar buttons sorted by the tasks I’m doing, not by the applications I’m using to work on this task. I might have Visual Studio open and a browser window with some tabs with related documentation but the other browser window I have open with just pictures of kittens is unrelated and should not be forced to be in the same group as the other browser window.

        1. Scarlet Manuka says:

          I tend to agree; I used very much to have “here’s an Excel spreadsheet with some data for this issue I’m looking at, next to an email message about the issue, next to an application window that I’m working in to resolve it” as my way of organising my taskbar (which was then, as now, usually around 30-40 items long). But remember, the main annoyance with that in the old days was that when Explorer inevitably forgot about one of those windows, you could switch to the window to remind it, but that window would migrate to the end of the taskbar and you had no way to put it back with the rest of its group. So the task groups were slowly destroyed over time anyway.

          Now you simply can’t group by functional task, only by application, but you can reorder with that restriction. It helps somewhat (e.g. I have a suite of programs that work together but have only one window each; when one window gets lost and pops up at the end of the taskbar I can pull it back to its group). But it’s certainly not as useful to me as “this group of mixed icons is for task A, the next group is for task B, the next group is for task C”. If we could turn off grouping altogether and still drag tasks around I would be happy, but I think that boat has long since sailed :)

          Ultimately it has to be about what’s best for most users, and I suspect our preferred way of working isn’t it. (And “make it an option” isn’t either, for reasons that Raymond has discussed extensively in the past.)

          1. DWalker says:

            Yes, these comments are what I was trying to say, but I didn’t say it as well. Thanks!

          2. DWalker says:

            You CAN turn off grouping altogether and drag the separate icons around however you want. (You can put icons from unrelated applications next to each other, but you can’t make them “group” together (and I would not want to)).

          3. skSdnW says:

            @DWalker: No you can’t! Start two instances of Notepad and one instance of Paint and try sorting them as | Notepad | Paint | Notepad |.

        2. Dark Daskin says:

          You can use multiple desktops to group windows by task. Linux users had this feature for years and Windows 10 users now have it too. Even in older versions of Windows there were 3rd-party utilities that simulate multiple desktops.

  7. no one seems to have mentioned… you CAN pin documents (TXT/DOCX/etc)… within the app group.

    I have notepad pinned. When you right click it, I see a list of recent text files (presumably opened in notepad?). I can right click any of those recent files, and pin it. In doing so, when I right click the Notepad icon, I see “Pinned” documents right above the “Recent” documents.

  8. Martin Bonner says:

    Well the right answer is to give up on this stupid grouping of documents by the application that opened them. What happened to “document centric computing”? But I can see, why this is a problem atm.

  9. henke37 says:

    Note that Internet Explorer considers itself an exception to this rule. It’s perfectly fine to pin websites to the taskbar.

    1. John Doe says:

      And have fancy icons. And still have tabs.

      This actually is such a big deal that I think it should have been made its own feature. It would be quite useful to pin documents (files, folders, URLs, things other than apps) to the taskbar.

      Or, at least, Office and other advanced applications should have followed lead from Internet Explorer.

      I, for instance, have several intranet sites pinned under IE. Since they even have a favicon.ico, I can easily distinguish them and mostly treat them like regular applications, if not for the fact I can still go back in history and open further tabs (quite useful for the bug tracking site, actually).

      I’ve also seen the few people who know about this (dragging a tab to the taskbar) pin their social sites, e-mail sites, cloud storage sites, etc. It’s that useful, and it’s such a counter argument to this whole post.

      I know, I can open a new tab, close the original tab, and now I just have a browser under a new fancy icon. Go ahead, mock yourself to laughter doing this kind of thing. I don’t care, I don’t waste my time trying to confuse myself in this way. If I had a special notepad just for that one log file, I simply wouldn’t open another file under it. But hey, let the user decide what he/she finds useful.

    2. If an app wants to change the window’s identity based on what document is loaded, it can. But the app decides this, because only the app knows what document is loaded. Explorer doesn’t know what document is loaded, so Explorer cannot do this automatically.

  10. Pinning documents seems weird; that’s something for the start menu or desktop.

    Generally I like the collapsed items on the task bar, however I really hate that with more than one instance open I can’t use the click to hide/unhide functionality anymore.

  11. Kevin says:

    You can do this on OS X, IIRC, but then when you try to drag your document back off of the dock onto the desktop, it just vanishes in a puff of smoke (because you were dragging a shortcut-like-icon, not a real file, so it can’t exist in the filesystem proper).

    Cue grandma freaking out because “the computer ate my Letter_to_grandson.doc!”

    Maybe Microsoft’s approach is superior.

Comments are closed.

Skip to main content