Portable Version Pin to Taskbar Issue
-
When using Notepad++ portable and you pin the icon to the Windows 10/11 taskbar, a new icon appears when you open an instance of Notepad++. The pinned icon does not become the active icon. However, if you click on the pinned icon, the active icon will appear.
Is there any way around this? This is not a Windows issue, although I have experienced this with other portable programs. However, I am also using portable software where, when pinned and opened, the pinned icon becomes the active icon.
-
This is not a Windows issue
It might not be a Windows “issue”, in that Windows might not be doing anything wrong, but it is caused by Windows, because Notepad++ (and other apps) have nothing to do with Windows “pin to taskbar” feature.
a new icon appears when you open an instance of Notepad++
That says one of a few possibilities, to me: most likely, you have two or more copies of portable Notepad++ executables, and the path to the pinned one is different to the path to the one you “normally run”; or maybe you have Notepad++ set to multi-instance mode (I haven’t tested, but I didn’t think multi-instance mode separated out on the taskbar, but maybe it does, which is why I suggested it)
I would say:
- look at the path of the pinned copy
- look at the ? > Debug Info for the click-on-pinned vs normally-opened, and see if the path or any other info is different
- check the multi-instance settings in the Preferences
-
Are you using the portable version from the Npp website? That’s the one I use and that doesn’t happen for me, no matter how I open Npp. I’m using Windows 10, though, and I have no idea if it might be different for Windows 11.
-
At first I thought I could replicate your issue but in then when trying to carefully to repeat my steps so I could document the reproduction steps I discovered that a pinned portable worked fine…
What I would do is to first unpin Notepad++, make sure no instances of Notepad++ are running, and then start a portable copy using however you normally start portable copies.
Once the portable copy is running then save a copy of Notepad++'s debug info in Microsoft Notepad. Then right on the Notepad++ on the task bar, pin it, and close/exit Notepad++ to have just the pin showing.
Do not start Notepad++ using the pin just yet. Instead, right click on the pin for Notepad++ in the task bar and right click the “Notepad++” at the top of the menu that shows up, and then left click on Properties. It defaults to the Shortcut tab of the properties and is in the Target field. I don’t see an obvious way to add the command line and so appended the command line parameters I wanted to the end of the Target field.
Save that to the shortcut and start Notepad++ using the pin. Get the debug info again and verify that the path and command line exactly match what you saved when you had first started the portable copy.
I had two strange things happen when I was trying to replicate. One of that was when copy/pasting the command line parameters I needed that the “quotes” around became unbalanced. It caused Notepad++ to try to create a file named “-multiInst” which I declined. I don’t know if I made a mistake or Windows did did something to unbalance the quotes. The result was when started Notepad++ that I got some odd behavior that seems much like what you saw. That’s why I’m suggesting to first get the debug info, then to fix up the Target, and them to re-verify the debug info once I have started Notepad++ using the pin.
The other strange thing is that I normally use an installed copy of Notepad++. In the process of testing pins all of the session/tabs from my portable copy ended up getting appended to the tabs/files for the installed copy. My installed copy is single instance and the portable copies are normally run with
-multiInst
. As pinning does not transfer the command line I had first accidentally started a portable copy using my new pin without command line parameters. That started the portable copy in single instance mode and I suspect Notepad++ has some instance sharing stuff that resulted in my portable tabs/files getting appended to the tabs used by the installed copy.