Programmatically (show and) configure Quick Launch toolbar on Win 10 taskbar

2.3k Views Asked by At

I am trying to show and configure Quick Launch toolbar on Win 10 taskbar from command line / batch file / registry patch / PowerShell script / VBS / C# / C++. After searching the Internet, I was able to accomplish two steps out of three:

  1. Pre-fill the "%USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch" folder with the .lnk files that I want to appear in the Quick Launch toolbar - this is easy.
  2. Force the Quick Launch to show on the taskbar by adding a specific blob into HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop key, TaskbarWinXP value and restarting Explorer so that the changes take effect. The format of the blob is not documented, but this is of no concern to me - I simply need to ensure that the taskbar contains only Quick Launch toolbar and no other toolbars, so I can afford to just prepare the taskbar on a test machine, export the blob and then import it into the registry on target machine. And the Quick Launch toolbar does show up on the taskbar and shows all the links corresponding to .lnk files. Not the most elegant way, but it works.

Update 0: actually it does not really work - the account name is hard-coded in the blob as part of the path to the Quick Launch folder, so when moving from a test machine to the target machine the blob will not work if the username is different of the target machine. I guess I will need to reverse-engineer the blob format anyway in order to generate a correct one.

  1. But, and this is where I am stuck, the Quick Launch toolbar needs further configuration programmatically, specifically:
    • Hide the toolbar title
    • Hide individual text for the link icons
    • Move the toolbar all the way to the left so that it is next to the Start button

I can't find any recipes for that.

These settings are not stored in the HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop key, TaskbarWinXP value blob, I did binary comparisons of different versions of this blob before and after manual change, they are identical. They must be stored somewhere else.

Update 1: I was wrong, these values are stored in the blob, but they are not committed to the registry right away by Windows Explorer. It seems like Explorer holds these values in RAM and only commits them to registry when it terminates normally, e.g. during logout or reboot. If you terminate Explorer by killtask, it won't commit these changes.

I also tried spying on the system using SysInternals procmon64 while I perform these three actions manually with a mouse. Process monitor does not detect any meaningful and relevant activities with either registry or files during such manual manipulations, only a bunch of background noise. But Explorer has to store these changing settings somewhere... What am I missing?

Update 2: As I have mentioned in the update 1, the reason I don't see any registry traffic when I am manually creating the toolbar is because Explorer postpones registry commit until normal shutdown.

So, after all updates, I have quite opposite situation: I no longer have issues with item 3, but I do need to know the format of the blob stored in registry HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop key, TaskbarWinXP value. Or a proper API to create such blob. Anyone has any pointers?

1

There are 1 best solutions below

1
On

OK, I have solved my problems. And I did not have to reverse-engineer the blob format for that (although I have started that fun process and managed to learn a few things about its internal structure). Anyway, my solution was this:

  1. On a clean test machine manually create a Quick Launch toolbar using the mouse, but, when asked to specify the path to the toolbar folder, instead of navigating step-by-step to C:\Users\<insert_your_fixed_username_here>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch, which would commit a fixed username into the blob as part of the path, you need to specify "%USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch" in Select Folder dialog as one line (the starting location for the Select Folder dialog is not important in this case). When you do that, Explorer will create a blob where the current user name is not hard-coded, and instead the environment variable %USERPROFILE% name is placed in the blob. This makes the blob re-usable for any user I want to deploy the Quick Launch toolbar to.
  2. Adjust the Quick Launch the way you desire (title, text, position, width, icon order).
  3. Log out from your account on test machine and log right back in. This is critically important - if you do not log out or if you kill Explorer, it will not commit your new toolbar settings to the registry.
  4. Export HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop key from the registry into the .reg file for future use.

The rest is easy, write a batch file that does the following:

  1. For each given user on the target machine prepares the "C:\Users\<insert_your_fixed_username_here>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch" folder and places necessary .lnk files there and deletes unnecessary ones.
  2. Imports .reg file into the target machine registry (reg import command).
  3. Kills and restarts Explorer: taskkill /f /IM explorer.exe & start explorer.exe

Now any desired user on your target machine will have exactly one Quick Launch toolbar and no other nonsense toolbars! And the toolbar will have the look and feel you want.

Tested on both real and virtual machines, works equally well.

Caveat: did not test on non-English version of Win10, and I expect localization issues because some folder names are hard-coded now.