Last active
November 1, 2024 11:42
-
-
Save hylickipiotr/98326e7ebe774871a24ce64b8c8e2963 to your computer and use it in GitHub Desktop.
Set mouse speed in windows 10 on startup using powershell and windows scheduler. Speed is in range 1-20 (default: 10).
This file contains hidden or 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([Int32]$Speed=10) | |
| $MethodDefinition = @" | |
| [DllImport("user32.dll", EntryPoint = "SystemParametersInfo")] | |
| public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, uint pvParam, uint fWinIni); | |
| "@ | |
| $User32 = Add-Type -MemberDefinition $MethodDefinition -Name "User32Set" -Namespace Win32Functions -PassThru | |
| $User32::SystemParametersInfo(0x0071,0,$Speed,0) | Out-Null | |
| Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name MouseSensitivity -Value $Speed |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-16"?> | |
| <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
| <RegistrationInfo> | |
| <URI>\Win10_SetMouseSpeed</URI> | |
| </RegistrationInfo> | |
| <Triggers> | |
| <LogonTrigger> | |
| <Enabled>true</Enabled> | |
| </LogonTrigger> | |
| </Triggers> | |
| <Settings> | |
| <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> | |
| <AllowStartOnDemand>true</AllowStartOnDemand> | |
| <Enabled>true</Enabled> | |
| <UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine> | |
| <ExecutionTimeLimit>PT0S</ExecutionTimeLimit> | |
| </Settings> | |
| <Actions> | |
| <Exec> | |
| <Command>powershell</Command> | |
| <Arguments>-windowstyle hidden -file "%USERPROFILE%\Win10_SetMouseSpeed.ps1" -speed 15</Arguments> | |
| </Exec> | |
| </Actions> | |
| </Task> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment