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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | $taskbarFile = "$env:windir\Taskbar.xml" [xml] $taskbarXml = @" <?xml version="1.0" encoding="utf-8"?> <LayoutModificationTemplate 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:
1 | 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