Published in Articles on by Michiel van Oosterhout ~ 2 min read

The Windows 11 taskbar consists of an item to show and hide the Start menu along with 4 items to show/hide Search, Task View, Widgets, and Chat (Microsoft Teams), pinned apps, and the system tray. The items and pinned apps are initially center-aligned, and the system tray is right-aligned. The taskbar can be personalized via the Settings app → Personalization → Taskbar. To automate the personalization we can add or update values in the Windows Registry directly.

Taskbar items in Windows 11
Taskbar items in Windows 11
# Paths of registry keys in the Windows Registry
$windows = "HKCU:\Software\Microsoft\Windows\CurrentVersion"
$search = "$windows\Search"
$explorer = "$windows\Explorer\Advanced"

# An array of registry values to be created or updated in the Windows Registry
$values = @(
    # Taskbar items
    # Search: Off
    @{ Path = $search; Name = "SearchboxTaskbarMode"; Value = 0 }
    # Task view: Off
    @{ Path = $explorer; Name = "ShowTaskViewButton"; Value = 0 }
    # Widgets: Off
    @{ Path = $explorer; Name = "TaskbarDa"; Value = 0 }
    # Chat: Off
    @{ Path = $explorer; Name = "TaskbarMn"; Value = 0 }

    # Taskbar behaviors
    # Taskbar alignment: Left
    @{ Path = $explorer; Name = "TaskbarAl"; Value = 0 }
    # Show recent searches when I hover over the search icon: Off
    @{ Path = $explorer; Name = "TaskbarSh"; Value = 0 }
)

$values | ForEach-Object {
    if (-not (Test-Path -Path $_.Path))
    {
        # Ensuring the registry key exists
        $key = New-Item -Force -ItemType Directory -Path $_.Path
    }

    # Force the (re)creation of the registry value
    $value = New-ItemProperty @_ -Force -PropertyType "DWord"
}

The settings used in this script are just suggestions for a minimalistic Windows 11 experience. You can change them, and you can add or remove additional settings. Note that the script above assumes all values are of type DWORD, which may or may not be the case of values you add in addition to the ones already in the script.