Launch a screensaver from a script or schedulded task

  • Thread starter Thread starter tod
  • Start date Start date
T

tod

Is there a way to write a vbscript that launches a a screensaver?

C:\WINDOWS\SYSTEM32\scrnsave.scr for example. I have a shortcut icon
in my Start Bar that contains this:

C:\WINDOWS\SYSTEM32\scrnsave.scr

as the Target. I can click the icon and the scrnsaver.scr launches and
my screen is blank.

I'd like to do something similar with a script or within a scheduled
task.

Here's more specificially what's going on. I have scheduled task that
launches an audio player in the morning. The player terminates the
screensaver and the otherwise dark room lights up. I'd like to append
to my scheduled task the ability to either not have the screensaver
terminate or launch the screensaver within a second of it being
terminated. So the room is once again dark.

Any ideas?

tod
 
Set WshShell = WScript.CreateObject("WScript.Shell")

'Run your music program
WshShell.Run ("C:\Program Files\MyProgram\MyMusicProgram.exe")

'Wait 5 seconds for your music program to load
WScript.Sleep 5000

'Run the Screen Saver
WshShell.Run ("C:\Windows\System32\scrnsave.scr")


Copy and paste the above into a Notepad file and save it with a VBS
extension. Then point the Scheduled Task to the VBS file you just saved.
Adjust the WScript.Sleep command if needed (time is in milliseconds).
You'll also need to change the path for your music program.
 
Back
Top