winutil icon indicating copy to clipboard operation
winutil copied to clipboard

Fix Task Manager AlwaysOnTop for Win11

Open zoicware opened this issue 2 weeks ago • 1 comments

Is your feature request related to a problem? Please describe

Currently the code only applies alwaysontop for taskmanager on windows 10 systems

Describe the solution you'd like

Recently found taskmanager saves its settings to : C:\Users\Username\AppData\Local\Microsoft\Windows\TaskManager\settings.json By simply adding the alwaysontop property we can automate this setting PowerShell Snippet:

$settingsFile = "$env:LOCALAPPDATA\Microsoft\Windows\TaskManager\settings.json"

#kill taskmanager if its open
Stop-Process -Name Taskmgr -Force -ErrorAction SilentlyContinue

$jsonContent = Get-Content -Path $settingsFile -Raw | ConvertFrom-Json
#add always ontop property
$jsonContent | Add-Member -NotePropertyName 'AlwaysOnTop' -NotePropertyValue $true -Force

$jsonContent | ConvertTo-Json -Depth 10 | Set-Content -Path $settingsFile

Describe alternatives you've considered

Additional context

Issue validation

  • [x] I checked for duplicate issues.
  • [x] I checked for already existing discussions.
  • [x] I checked for an already existing pull request addressing the issue.

zoicware avatar Feb 09 '25 02:02 zoicware