Advertisement
Guest User

Untitled

a guest
May 3rd, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. param(
  2. [int]$Delay = 0
  3. )
  4. $Win32 = Add-Type -Name WinAPICall -Namespace SystemParametersInfo -PassThru -MemberDefinition @'
  5. [DllImport("user32.dll", EntryPoint = "SystemParametersInfo")]
  6. public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, uint pvParam, uint fWinIni);
  7. '@
  8. if($Win32::SystemParametersInfo(0x17,$delay,$null,0)) {
  9. Write-Host "Keyboard delay changed to: $delay"
  10. } else {
  11. Write-Host "There was an error while changing the keyboard delay."
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement