0

I managed a fleet of Windows 10 workstations, including for some semi-public lab and classroom locations. One of the things I want to do is make it easier for people to log out. The "logout" option in the Windows 10 start menu is kind of hidden. Adding an icon on the taskbar to make this easier to find and see will hopefully translate to fewer situations where someone just walks away and the next person to come by can access all their stuff.

To make this happen I have a small vbscript file to logout after a Yes/No prompt, and a shortcut (lnk) file for this script deployed to all the workstations. I also have a nice icon modeled after the actual logout icon on the start menu, which is assigned to the shortcut.

Now I want to pin this to taskbar. To make it happen, I have a test xml file where the relevant portion looks like this:

<CustomTaskbarLayoutCollection  PinListPlacement="Replace">
<defaultlayout:TaskbarLayout>
    <taskbar:TaskbarPinList>
        <taskbar:DesktopApp DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\Sign Out.lnk" />
        <taskbar:UWA AppUserModelID="Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" />
        <taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Firefox.lnk" />
        <taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Google Chrome.lnk" />
        <taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\File Explorer.lnk" />
        <taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Word.lnk" />
        <taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Excel.lnk" />
        <taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\PowerPoint.lnk" />
    </taskbar:TaskbarPinList>
</defaultlayout:TaskbarLayout>
</CustomTaskbarLayoutCollection>

Notice that Sign Out.lnk is the first item listed. For the test I just used some standard browsers/office apps. I run the Import-Layout commandlet, and the taskbar looks like this:

Start Menu Layout

Instead of the Sign Out icon first, we see Edge. The File Explorer Icon is also a couple places to the left of where it appears in the file.

I have a dedicated account I use for testing. Each time I try something I log in as my main account, delete the profile, run the Import-Layout command, and then log out and log back in with the test account. I know I'm using the right file, and that the process generally works, because I can see other changes. Adding or a removing a different icon, for example, would show up after a test cycle. I'm using Windows 10x64 20H2 Enterprise for this test.

I don't much care about the rest of it, but this Sign Out icon was built to match the task view and Cortana icons, and I'd really like it to appear first, next to them. What could be going wrong here?

Update

I had an idea almost as soon as I finished typing the question. I think I understand what may be happening, but not how to fix it.

The documentation has this information:

The order of apps in the XML file dictates the order of pinned apps on the taskbar from left to right, to the right of any existing apps pinned by the user.

(emphasis mine)

If the default profile already has Edge and File Explorer pinned, this would explain why the appear all the way to left. Now I need to figure out how to un-pin them from the default profile, or at least the File Explorer, because I do want that application in the final result.

So how can I unpin taskbar items from the default profile I can't log into?

...

I have now also tried importing a layout with only one icon, hoping to force that initial layout to unpin those icons, and then afterwards importing the desired layout. This did not work.

1 Answer 1

0

What I'm going with is a shortcut to wscript.exe that in turn runs a short vbs file to start Explorer. I can set the correct icon and pin this to the taskbar, and it looks identical to the user.

I'm not... I'm not thrilled with this. I'd still like to find a way to get the real shortcut to go where I want it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .