Generate the XML Script for Taskbar Configuration

Start by creating an XML file that specifies which applications you want to pin to the taskbar. Below is a script that generates such an XML:

  • Here is the script to generate the XML
$taskbarFile = "$env:windir\Taskbar.xml"
[xml]$taskbarXml = @"
<?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:DesktopApp DesktopApplicationID="Microsoft.Windows.Explorer" />
        <taskbar:DesktopApp DesktopApplicationID="Chrome"/>
        <taskbar:DesktopApp DesktopApplicationID="Microsoft.Office.OUTLOOK.EXE.15" />
        <taskbar:DesktopApp DesktopApplicationID="Microsoft.Office.EXCEL.EXE.15" />
        <taskbar:DesktopApp DesktopApplicationID="Microsoft.Office.WINWORD.EXE.15" />		
      </taskbar:TaskbarPinList>
    </defaultlayout:TaskbarLayout>
 </CustomTaskbarLayoutCollection>
</LayoutModificationTemplate>
"@
if (-NOT[string]::IsNullOrEmpty($taskbarXml)) { $taskbarXml.Save($taskbarFile) }
Import-StartLayout -LayoutPath $taskbarFile -MountPath $env:SystemDrive\

Identifying Applications for Pinning:

To determine which applications you can pin to the taskbar, use the following command:

Get-StartApps

This command will provide a list of all the applications available for pinning.


1 Comment

Sam · 28 November 2024 at 9h11

according to MS, Import-StartLayout no longer works for Windows 11 🙁

“Caution

The use of the Import-StartLayout PowerShell cmdlet to provision the Taskbar layout is no longer supported in Windows 11.”

Source https://learn.microsoft.com/en-us/windows/configuration/taskbar/pinned-apps?tabs=ppkg&pivots=windows-11

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.