New
#40
Okey doke. Posting here is fine if you like.
Hi Shawn. Because of a conflict with playing music (the script closes WMP), I thought I'd do some research and try a box instead. It works except the box doesn't get killed after showing up the way WMP does. Here's what I've got so far:
Registry = "HKCU\Control Panel\Desktop\ScreenSaveActive"
Set Command1 = WScript.CreateObject("WScript.Shell")
Set command2 = CreateObject("Wscript.Shell")
Set oVoice = CreateObject("SAPI.SpVoice")
Check = Command1.RegRead(Registry)
If Check = 1 Then
Command1.RegWrite Registry, 0, "REG_SZ"
x=msgbox("screen saver has been disabled" ,0, SSD)
WScript.sleep 1000
command2.Run "taskkill /f /im wscript.exe", 0
Else
Command1.RegWrite Registry, 1, "REG_SZ"
x=msgbox("screen saver has been enabled" ,0, SSD)
WScript.sleep 1000
command2.Run "taskkill /f /im wscript.exe", 0
End If
And please tell me if you're offended or I've broken any rules or shown bad manners in reverse engineering your code.
I'm not offended at all. I thought that I had removed the bit about killing WMP since it was no longer used in the script. Thank you for letting me know.
I have updated the .vbs file from step 1 in OPTION ONE. Please try the new version, and let me know how it works for you now. :)
Last edited by Brink; 18 Mar 2015 at 14:01. Reason: typo
Super, Shawn. Works without closing or even interrupting the music playing on WMP. Just runs simultaneously! Thanks!
BTW, I figured out how to make the box notice disappear too. I just dragged the .vbs file to the taskbar and clicked the scripts icon. I clicked the box to make it time out in 1 second. Now a box opens that says "Screen saver is enabled" or "Screen saver is disabled" and disappears.
Shawn, this is a great tutorial - thx! Works great UNLESS:
I notice that when the toggle state is in 'off' mode and the Screensaver Settings has the 'On resume, display logon screen' box checked that the logon on screen displays after the "Wait' period. Thoughts?
Thx Shawn -
I am curious as to how to know if the computer is in the off or on state other than having to wait for the Screen Saver Setting 'wait' period. I think it would be so cool if an icon like the Recycle bin (e.g. wastebasket with/without waste) could be developed for this.
Thoughts?