Skip to content

Instantly share code, notes, and snippets.

@useafterfree
Created June 17, 2022 20:33
Show Gist options
  • Save useafterfree/5eb8b9084eb978fde8b0278b07fd47db to your computer and use it in GitHub Desktop.
Save useafterfree/5eb8b9084eb978fde8b0278b07fd47db to your computer and use it in GitHub Desktop.
Powershell script to set Real time mouse input WIN10/WIN11
param([switch]$Elevated)
function Test-Admin {
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
if ((Test-Admin) -eq $false) {
if ($elevated) {
# tried to elevate, did not work, aborting
} else {
Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition))
}
exit
}
'running with full privileges'
Get-WmiObject Win32_process -filter 'name = "winlogon.exe"' | foreach-object { $_.SetPriority(256) }
stop-process -Id $PID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment