How to prevent screensaver

3

How can I prevent screensaver to run on windows xp? I can't disable it because of some security software, but if there is a small program that can simulate some keypress every 2-3 min that should do the job.

Pablo

Posted 2010-06-07T05:35:47.113

Reputation: 4 093

comment from northirid: Something like this? http://xkcd.com/196/ ;)

– quack quixote – 2010-06-07T22:36:04.600

Answers

2

There are some freeware's to do this job,

ukanth

Posted 2010-06-07T05:35:47.113

Reputation: 9 930

Thanks. Any other software that I will be able to configure which kep it will simulate? I need the scroll lock to be simulated. BTW: StopSS didn't work for some reason. Monitor ES as well... – Pablo – 2010-06-07T06:00:53.217

@Michael, Surprised that it doesn't work for you. Perfectly working for me. – ukanth – 2010-06-07T06:48:54.247

1

You can run a PowerShell like the one below. No installation required:

Clear-Host
# Lines needed for the notification
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
Add-Type -AssemblyName System.Windows.Forms 

$form = New-Object System.Windows.Forms.Form
$Timer = New-Object System.Windows.Forms.Timer
$ContextMenu = New-Object System.Windows.Forms.ContextMenu
$MenuItem = New-Object System.Windows.Forms.MenuItem

$form.ShowInTaskbar = $false
$form.WindowState = "minimized"

$ToggleCount = 0

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

$Logfile = "$($env:userprofile)\SLJog_$(gc env:computername).log"
#Write Host $Logfile

$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon 
$objNotifyIcon.Icon = "C:\Program Files\Microsoft Office\Office16\FORMS\1033\RECL.ico"
$objNotifyIcon.ContextMenu = $ContextMenu
$objNotifyIcon.ContextMenu.MenuItems.AddRange($MenuItem)
$objNotifyIcon.Text = "Scroll Lock Toggle"
$objNotifyIcon.Visible = $True

$MenuItem.Text = "Exit"
$MenuItem.add_Click({
   $Timer.Stop()
   $Timer.Dispose()
   $objNotifyIcon.Visible = $False
   LogWrite ("$($time), Reference position:X  $($global:p1.X)xY $($global:p1.Y), Current position:X $($global:p2.X)xY $($global:p2.Y),ToggleCount: $($ToggleCount) , Application exitted.")
   $form.Close()
})

$p1 = [System.Windows.Forms.Cursor]::Position
$p2 = [System.Windows.Forms.Cursor]::Position

$time = get-date -Format FileDateTime
#Write Host "ToggleCount: $($ToggleCount) , $($time) "
LogWrite ("$($time), Reference position:X  $($global:p1.X)xY $($global:p1.Y), Current position:X $($global:p2.X)xY $($global:p2.Y),ToggleCount: $($ToggleCount) , Application started")

$Timer.Interval = 300000 # (5 min)
$Timer.add_tick({Toggle-SL})
$Timer.Enabled = $true
$Timer.Start()

Function LogWrite
{
   Param ([string]$logstring)
   Add-content $Logfile -value $logstring
}

function Toggle-SL()
{
   $time = get-date -Format FileDateTime
   #Write Host "Timer toggled" 
   $global:p2 = [System.Windows.Forms.Cursor]::Position
   LogWrite ("$($time), Reference position:X  $($global:p1.X)xY $($global:p1.Y), Current position:X $($global:p2.X)xY $($global:p2.Y),ToggleCount: $($ToggleCount) , Timer triggered")

   if ($global:p1.X -ne $global:p2.X -or $global:p1.Y -ne $global:p2.Y) {
    $global:ToggleCount = 0
    LogWrite ("$($time), Reference position:X  $($global:p1.X)xY $($global:p1.Y), Current position:X $($global:p2.X)xY $($global:p2.Y),ToggleCount: $($ToggleCount) , Movement detected, togglecount zeroed")
    }
   If ($global:p1.X -eq $global:p2.X -and $global:p1.Y -eq $global:p2.Y -and $global:ToggleCount -lt 12) 
    {
    $objNotifyIcon.Icon = "C:\Program Files\Microsoft Office\Office16\FORMS\1033\CNFNOT.ico"
    $objNotifyIcon.Text = "Scroll Lock Toggle - Toggled $($global:ToggleCount) times"
    $WShell.sendkeys("{SCROLLLOCK}")
    $global:p1.X = $global:p1.X + 5
    $global:p1.Y = $global:p1.Y + 5
    [System.Windows.Forms.Cursor]::Position = $global:p1.X,$global:p1.Y
    Start-Sleep -Milliseconds 100
    $WShell.sendkeys("{SCROLLLOCK}")
    $global:p1.X = $global:p1.X - 5
    $global:p1.Y = $global:p1.Y - 5
    [System.Windows.Forms.Cursor]::Position = $global:p1.X,$global:p1.Y
     $global:ToggleCount++
     LogWrite ("$($time), Reference position:X  $($global:p1.X)xY    $($global:p1.Y), Current position:X $($global:p2.X)xY $($global:p2.Y),ToggleCount: $($ToggleCount) , SL Toggled.")
    }
  $global:p1 = [System.Windows.Forms.Cursor]::Position
  #Write Host "ToggleCount: $($ToggleCount) , $($time) "
  $objNotifyIcon.Icon = "C:\Program Files\Microsoft Office\Office16\FORMS\1033\RECL.ico"
  $objNotifyIcon.Text = "Scroll Lock Toggle - Toggled $($global:ToggleCount) times"
}

[void][System.Windows.Forms.Application]::Run($form)

IMFerret

Posted 2010-06-07T05:35:47.113

Reputation: 11