Ironman Software Forums
Continue the conversion on the Ironman Software forums. Chat with over 1000 users about PowerShell, PowerShell Universal, and PowerShell Pro Tools.
Windows 11 currently does not have the option to change the taskbar location in the settings dialog.
This post provides a PowerShell script to easily change the taskbar location.
The Windows 11 taskbar registry setting can be found in HCKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3
. The settings value of this key contains a binary blob that defines settings for the taskbar. You can adjust the taskbar location by change the 13th value of the structure.
The valid values are the following.
Left: 0
Top: 1
Right: 2
Bottom: 3
To simplify changing this value, you can use the following PowerShell function. It reads the current value of StructRects2
and sets the desired taskbar location. You’ll need to restart explorer for the option to take effect.
function Set-TaskbarLocation {
param(
[Parameter(Mandatory)]
[ValidateSet("left", "right", "top", "bottom")]
$Location,
[Parameter()]
[Switch]$RestartExplorer
)
$bit = 0;
switch ($Location) {
"left" { $bit = 0x00 }
"right" { $bit = 0x02 }
"top" { $bit = 0x01 }
"bottom" { $bit = 0x03 }
}
$Settings = (Get-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3 -Name Settings).Settings
$Settings[12] = $bit
Set-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3 -Name Settings -Value $Settings
if ($RestartExplorer) {
Get-Process explorer | Stop-Process
}
}
To set the Windows 11 taskbar to the top of the screen, use the following command line.
Set-TaskbarLocation -Location Top -RestartExplorer
Find this useful? Please consider sharing this article. Have a question about PowerShell? Contact us and we'll write a post about it.
Continue the conversion on the Ironman Software forums. Chat with over 1000 users about PowerShell, PowerShell Universal, and PowerShell Pro Tools.
Receive once-a-month updates about Ironman Software. You'll learn about our product updates and blogs related to PowerShell.