Fixing Borderless Windows in Windows Server 2019 and Windows Server 2022

Starting with Windows Server 2019 someone at Microsoft apparently thought it was a great idea to make the various application-windows borderless, making it really hard to see the windows. Below is an example of two File Explorer windows overlapping, the arrow pointing to the top border of the window in front.

Borderless Windows

The Fix via PowerShell – Current User

Fixing the issue is quite easy, simply add a registry key the restores the behavior back to how it was in Windows Server 2016. Here is a PowerShell snippet that does it for you:

$RegistryKey = "HKCU:Control Panel\Desktop"
$Name = "UserPreferencesMask"
$Value = ([byte[]](0x90,0x32,0x07,0x80,0x10,0x00,0x00,0x00))
$Type = "Binary"
New-ItemProperty -Path $RegistryKey -Name $Name -Value $Value -PropertyType $Type -Force

Note: You need to log out and login for the setting to take effect.

Windows with Borders

The Fix via PowerShell – Default User

If you rather change it for all users, for example during deployment, you can load the default user registry and set the value there. Here is an example:

# Load the offline registry hive from the OS volume
$HivePath = "C:\Users\Default\NTUSER.DAT"
New-PSDrive -PSProvider Registry -Root HKEY_USERS -Name HKU
reg load "HKU\Tmp" $HivePath 
Start-Sleep -Seconds 5

# Updating default registry hive to show Windows Borders
$RegistryKey = "HKU:Tmp\Control Panel\Desktop"
$Name = "UserPreferencesMask"
$Value = ([byte[]](0x90,0x32,0x07,0x80,0x10,0x00,0x00,0x00))
$Type = "Binary"
New-ItemProperty -Path $RegistryKey -Name $Name -Value $Value -PropertyType $Type -Force

# Cleanup (to prevent access denied issue unloading the registry hive)
Get-Variable Registry* | Remove-Variable
Start-Sleep -Seconds 5

# Unload the registry hive
reg unload "HKU\Tmp" 

The Fix via Group Policy Preference

If using legacy Active Directory, you can also create a Group Policy Preference that sets the value. Create a new Group Policy and navigate to User Configuration / references / Windows Settings / Registry. Then add a Registry Item with the following settings:

  • Action: Update
  • Key Path: Control Panel\Desktop
  • Value name: UserPreferencesMask
  • Value type: REG_BINARY
  • Value data: 9032078010000000
Creating a Group Policy Preference
About the author

Johan Arwidmark

5 5 votes
Article Rating
Notify of
1 Comment
Oldest Most Voted
Inline Feedbacks
View all comments
1 month ago

Thanks Johan, excellent like always.