Windows – Stop currently running Windows screensaver from command line

command linescreensaverwindows

I have a number of Scheduled Tasks running on a Windows machine, which is design to run stand alone and show useful information to the office.

Part of it's use is to run a screensaver that itself shows useful information.

There are some scheduled tasks which need to display information to the screen, however as the screensaver is running these messages can't be seen until the screensaver it manually deactivated.

How can the currently running screensaver in Windows be deactivated from command script?

Best Answer

You can do this using PowerShell to move the mouse a pixel, deactivating the screensaver.

$Pos = [System.Windows.Forms.Cursor]::Position
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point((($Pos.X) + 1) , $Pos.Y)

You can also try a 3rd party program, such as AutoIt, which allows you to script mouse movements.

Related Question