After installing an application in Windows 10, it is often helpful to add an icon for the application to the taskbar. Some work with Microsoft PowerShell and editing of XML is needed to do this.
- Open a text editor such as Notepad and copy/paste in the following XML, which contains entries for Microsoft Edge, File Explorer, PuTTY, WinSCP, ExpanDrive, and Map AFS:
<?xml version="1.0" encoding="utf-8"?>
<LayoutModificationTemplate
xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification"
xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout"
xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout"
xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout"
Version="1">
<CustomTaskbarLayoutCollection PinListPlacement="Replace">
<defaultlayout:TaskbarLayout>
<taskbar:TaskbarPinList>
<taskbar:UWA AppUserModelID="Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" />
<taskbar:DesktopApp DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\File Explorer.lnk" />
<taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\PuTTY\PuTTY.lnk" />
<taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\WinSCP.lnk" />
<taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\ExpanDrive\ExpanDrive.lnk" />
<taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\OpenAFS\Map AFS.lnk" />
<Custom entry here>
</taskbar:TaskbarPinList>
</defaultlayout:TaskbarLayout>
</CustomTaskbarLayoutCollection>
</LayoutModificationTemplate> - To add another entry to the taskbar, replace the <Custom entry here> line with an entry for the desired application. You will need to determine the shortcut link to the application. You can use File Explorer to locate existing links and manually type out the path to them. If there is a link to the application in the start menu (or you can add it to the start menu), the following PowerShell command can be used to dump the XML of the start menu to a file. Then, the link can be obtained from the file. This command can also be used to determine the ID for Microsoft App Store applications (see the entry for Microsoft Edge in the above XML for an example).
NOTE To run PowerShell (as administrator), right click the Start Menu and click “Windows PowerShell (admin)”.
Export-StartLayout -Path c:\menu.xml
- Next, open c:\menu.xml in a text editor such as Notepad.
- Find the link for the desired application in the file and copy the value for DesktopApplicationLinkPath, for example
<start:DesktopApplicationTile Size="2x2" Column="2" Row="2" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\SAS\SAS 9.4 (English).lnk" />
- Then, in your XML file for the taskbar, create an entry using the shortcut link that has the following form:
<taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\SAS\SAS 9.4 (English).lnk" />
- After adding any desired entries, carefully check your syntax and save the file as taskbar.xml in your Documents directory
- Open PowerShell if you do not already have it running (right click on the Start Menu icon and click “Windows PowerShell (admin)”)
- Run the following command to import the XML (replacing userid with your own userid):
Import-StartLayout -layoutpath C:\Users\userid\Documents\taskbar.xml -Mountpath C:\
- If no errors are displayed, the command ran successfully. If there are errors displayed, they are probably related to a syntax problem in the file. Carefully review your file and repeat the import command.
NOTEĀ Your taskbar will not change!
New accounts will now see the new set of items on the taskbar. This can be tested by adding a new account, logging out, and logging in with the new account.