tuzichun

电脑防止锁屏脚本

Add-Type -AssemblyName System.Windows.Forms

# 你可以根据你的实际情况修改间隔时间
New-Variable -name INTERVAL -Value (60 * 3) -Option Constant -Description \'for 5mins lock default\'

get-date
echo `start`

while ($true) {
    $key = \'{NUMLOCK}\'
    get-date
    echo  "press key $key`n"
    try {
        [System.Windows.Forms.SendKeys]::SendWait($key)
        [System.Windows.Forms.SendKeys]::SendWait($key)
    }
    catch {
        Write-Host "An error occurred:"
        Write-Host $_
        Write-Host $_.ScriptStackTrace
    }
    sleep -s $INTERVAL
}

分类:

技术点:

相关文章:

  • 2022-01-18
  • 2021-09-20
  • 2021-12-22
  • 2021-12-01
  • 2021-11-23
  • 2021-12-09
猜你喜欢
  • 2021-08-28
  • 2021-08-28
  • 2021-08-28
  • 2022-02-21
  • 2022-12-23
  • 2021-11-17
  • 2022-02-04
相关资源
相似解决方案