Przejdź do treści

Powershell – Skrypt Blokada przed blokowanie ekranu

PowerShell-screen_lock_proteced.ps1

Wciśnij klawisz co 1 minute

param($minutes = 720)

write "... screen will be awake for $minutes"

 $myshell = New-Object -com "Wscript.Shell"

 for ($i = 0; $i -lt $minutes; $i++) {
 write "... screen will be awake for" ($minutes-$i)
 Start-Sleep -Seconds 60    
 write "60 sec left"
 $myshell.sendkeys("{F15}")
}

Rusz myszką

Add-Type -AssemblyName System.Windows.Forms
while ($true)
{
  $Pos = [System.Windows.Forms.Cursor]::Position
  $x = ($pos.X) + 1
  $y = ($pos.Y) + 1
  [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
  Start-Sleep -Seconds 5
}


write "... screen will be awake for $minutes"
$myshell = New-Object -com "Wscript.Shell"
 while ( 1 -eq 1 ){
 Start-Sleep -Seconds 60    
 $myshell.sendkeys("{SCROLLLOCK}")

}

Dodaj komentarz

Twój adres email nie zostanie opublikowany. Wymagane pola są oznaczone *