Screen Saver - Toggle On or Off - Add to Desktop Context Menu

Page 5 of 6 FirstFirst ... 3456 LastLast

  1. Posts : 72,051
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #40

    Okey doke. Posting here is fine if you like.
      My Computer


  2. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #41

    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.
      My Computer


  3. Posts : 72,051
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #42

    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
      My Computer


  4. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #43

    Super, Shawn. Works without closing or even interrupting the music playing on WMP. Just runs simultaneously! Thanks!
      My Computer


  5. Posts : 72,051
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #44

    Perfect.
      My Computer


  6. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #45

    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.
      My Computer


  7. Posts : 72,051
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #46

    Good news.
      My Computer


  8. Posts : 1,364
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #47

    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?
      My Computer


  9. Posts : 72,051
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #48

    I don't think that can be bypassed other than unchecking the "On resume..." box.
      My Computer


  10. Posts : 1,364
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #49

    Brink said:
    I don't think that can be bypassed other than unchecking the "On resume..." box.
    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?
      My Computer


 
Page 5 of 6 FirstFirst ... 3456 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:53.
Find Us