Trigger screensaver via batch file

Post your questions, bug reports and feature requests here
Post Reply
marty.vdh
Posts: 1
Joined: Mon Aug 02, 2021 6:51 am

Trigger screensaver via batch file

Post by marty.vdh »

Is there a way the screen saver can be triggered via scripting, either as a batch file or VBS ?

When I call gPhotoShow.scr it is loading the configuration window rather than the screensaver itself.

Thanks,
Marty
User avatar
gpb
Site Admin
Posts: 761
Joined: Mon Dec 19, 2011 1:23 am

Re: Trigger screensaver via batch file

Post by gpb »

Hello,
to run a screensaver you must add the /s parameter:
gPhotoShow.scr /s

this command will run gPhotoShow directly without locking the pc, to lock the pc and start the default screen saver you should send the message WM_SYSCOMMAND with wparam set to SC_SCREENSAVE to the desktop window:
https://docs.microsoft.com/en-us/window ... syscommand
Gianpaolo Bottin
gPhotoShow.com
Post Reply