Created
June 17, 2022 20:33
-
-
Save useafterfree/5eb8b9084eb978fde8b0278b07fd47db to your computer and use it in GitHub Desktop.
Powershell script to set Real time mouse input WIN10/WIN11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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