Skip to content

Instantly share code, notes, and snippets.

@stuartleeks
Last active October 8, 2021 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuartleeks/3208fd2b9e5233879f3455dedb97faed to your computer and use it in GitHub Desktop.
Save stuartleeks/3208fd2b9e5233879f3455dedb97faed to your computer and use it in GitHub Desktop.
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[ValidateSet("Top", "Bottom")]
[string]
$Position
)
# 0 - Left (doesn't work well)
# 1 - Top
# 2 - Right (doesn't work well)
# 3 - Bottom
enum Position {
Top = 1
Bottom = 3
}
# Convert input to int value
$posValue = [Position]$Position
$settings = (Get-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3\).Settings
$settings[12] = $posValue
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3\ -Name Settings -type Binary -Value $settings
Stop-Process -Name explorer
# if explorer doesn't restart, run explorer.exe manually
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment