Windows scripts
Power Toys
Power toys are useful utilities provided by Microsoft. You can install them from winget:
winget install -e --id Microsoft.PowerToysOr directly from here.
It includes utilities such as:
- PowerToys Run: Quick launcher similar to macOS Spotlight
- Awake: Prevent your computer from going to sleep or turning off the screen
- FancyZones: Advanced window manager to create custom window layouts
- PowerRename: Bulk renaming of files with advanced options
- Always on Top: Pin windows to stay on top of others
- Color Picker: Pick colors from anywhere on the screen
- Workspace: Manage virtual desktops easily
And many more!
Old context menu
The new context menu introduced in Windows 11 requires two clicks to access certain features. It may seem like a minor detail, but over time it becomes quite a hassle.

Show script
reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /veShow hidden power plan options
By default, Windows hides some CPU power-management options that can help reduce power consumption on systems with many cores. This script allows you to manage the number of parked cores (cores that Windows keeps idle) and to directly adjust the maximum CPU frequency.
In my case, it helps a lot: my laptop no longer tries to boost the CPU frequency whenever I launch an application. Some apps may take slightly longer to start, but my fans stay off and my battery lasts much longer.

Show script
# Script to show hidden power plan options in Windows 10 and Windows 11
# Add park core option to power plan settings
#============================================
$ParkCoreRegistryPath = "HKLM:\SYSTEM\ControlSet001\Control\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\0cc5b647-c1df-4637-891a-dec35c318583"
$ParkCoreName = "Attributes"
$ParkCoreValue = 2
# Check if the registry key exists
If (-NOT (Test-Path $ParkCoreRegistryPath)) {
Write-Output "Registry key not found"
Exit
}
# Set the registry value
Else {
Set-ItemProperty -Path $ParkCoreRegistryPath -Name $ParkCoreName -Value $ParkCoreValue
}
# Add processor maximum frequency option to power plan settings
#==============================================================
$ProcessorMaxFrequencyRegistryPath = "HKLM:\SYSTEM\ControlSet001\Control\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\75b0ae3f-bce0-45a7-8c89-c9611c25e100"
$ProcessorMaxFrequencyName = "Attributes"
$ProcessorMaxFrequencyValue = 2
# Check if the registry key exists
If (-NOT (Test-Path $ProcessorMaxFrequencyRegistryPath)) {
Write-Output "Registry key not found"
Exit
}
# Set the registry value
Else {
Set-ItemProperty -Path $ProcessorMaxFrequencyRegistryPath -Name $ProcessorMaxFrequencyName -Value $ProcessorMaxFrequencyValue
}Add Passive power plan
This power plan is a bit more agressive than standard powsersaver. It is tune for my machine, but you can easily tune it by changing the max frequency for cpu and number on parked This power plan is a bit more aggressive than the standard Power Saver. It is tuned for my machine, but you can easily adjust it by changing the maximum CPU frequency and the number of parked cores. Parked cores are CPU cores that Windows tries not to wake; they stay in a high C-state, which significantly reduces power consumption. The max-frequency cap prevents Windows from triggering a large turbo boost when you’re simply launching Chrome.
This setup nearly doubles my laptop’s battery life. Make sure to also check your GPU settings to improve battery life even further.
This script also adds desktop shortcuts to easily switch between power plans.
Show script
# Script to add passive power plan to Windows 10 and Windows 11
# This script reduce number of active cores and prevent cpu from boosting
# This script is useful for reducing power consumption and heat generation
# It allow use of laptop fully passive without fan noise
# Function:
#==========
function Get-GUIDFromInput {
param (
[string]$InputString
)
if ($InputString -match '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}') {
$guid = $matches[0]
return $guid
} else {
return $null
}
}
# Add passive power plan to power plan settings
#==============================================
# Define the name for the new power plan
$PowerPlanName = "Passive"
$CpuMaxFreqDC = 1900
$CpuMaxFreqAC = 2300
$CpuParkedCoresDC = 50
$CpuParkedCoresAC = 50
$PowerSaverGUID = "a1841308-3541-4fab-bc81-f71556f20b4a"
$BalancedGUID = "381b4222-f694-41f0-9685-ff5bb260df2e"
# Create a new power plan
$Passive = powercfg -duplicatescheme $PowerSaverGUID
$PassiveGUID = Get-GUIDFromInput -InputString $Passive
if ($null -eq $PassiveGUID) {
Write-Output "Failed to create new power plan."
Exit
}
Write-Output "New power plan created with GUID: $PassiveGUID"
cmd /c "powercfg -changename $PassiveGUID $PowerPlanName"
Write-Output "Power plan name changed to: $PowerPlanName"
# Set additional custom settings for the "Passive" power plan
#===========================================================
# Set max CPU frequency on DC to 1900MHz
cmd /c "powercfg -setdcvalueindex $PassiveGUID SUB_PROCESSOR PROCFREQMAX $CpuMaxFreqDC"
# Set max CPU frequency on AC to 2300MHz
cmd /c "powercfg -setacvalueindex $PassiveGUID SUB_PROCESSOR PROCFREQMAX $CpuMaxFreqAC"
# Set parked CPU cores to 50% for both AC and DC
cmd /c "powercfg -setdcvalueindex $PassiveGUID SUB_PROCESSOR CPMINCORES $CpuParkedCoresDC"
cmd /c "powercfg -setacvalueindex $PassiveGUID SUB_PROCESSOR CPMINCORES $CpuParkedCoresAC"
# Add Desktop shortcut for easy toggling between power plans
#===========================================================
$DesktopPath = [System.Environment]::GetFolderPath("Desktop")
$ShortcutPath = Join-Path -Path $DesktopPath -ChildPath "Balanced.lnk"
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutPath)
$Shortcut.TargetPath = "cmd.exe"
$Shortcut.Arguments = "/c start /min powercfg -setactive `"$BalancedGUID`""
$Shortcut.IconLocation = Join-Path -Path $PSScriptRoot -ChildPath "icons/Balanced.ico"
$Shortcut.Save()
Write-Output "Desktop shortcut created for Balanced power plan"
$ShortcutPath = Join-Path -Path $DesktopPath -ChildPath "Passive.lnk"
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutPath)
$Shortcut.TargetPath = "cmd.exe"
$Shortcut.Arguments = "/c start /min powercfg -setactive `"$PassiveGUID`""
$Shortcut.IconLocation = Join-Path -Path $PSScriptRoot -ChildPath "icons/Passive.ico"
$Shortcut.Save()
Write-Output "Desktop shortcut created for Passive power plan"Last active click
Change taskbar behavior to switch between instance of an app when user click on it. It allows easy switching between browser windows by clicking on taskbar icon for example.
Credit: Shawn Brink
Show script
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"LastActiveClick"=dword:00000001