Hourly Chime with Task Scheduler  


  1. Posts : 22
    Windows 10
       #1

    Hourly Chime with Task Scheduler


    I have been trying to setup an hourly chime sound to stop my Logitech Z906 sound system from switching off when no activity on my computer.
    I copied this program that someone had used but cannot get it working on Task Scheduler..
    Option Explicit


    Dim sound : sound = "C:\Windows\Media\Alarm01.wav"

    Dim o : Set o = CreateObject("wmplayer.ocx")
    With o
    .url = sound
    .controls.play
    While .playstate <> 1
    wscript.sleep 100
    Wend
    .close
    End With

    Set o = Nothing

    I saved it in Notepad as a .vbs file on my desktop.

    If I double click on it on my desktop it works fine but not when on Task scheduler.

    The following are my Task Scheduler Settings...

    Hourly Chime with Task Scheduler-general-tab.jpgHourly Chime with Task Scheduler-trigger-tab.jpgHourly Chime with Task Scheduler-action-tab.jpgHourly Chime with Task Scheduler-conditions-tab.jpgHourly Chime with Task Scheduler-settings-tab.jpg

    Can anyone see where I am going wrong?
    Thanks in advance...
      My Computer


  2. Posts : 1,613
    X
       #2

    In the "Edit Action" panel, I think the program should be:
    C:\Windows\system32\cscript

    and the arguments should be:
    "C:\Users\richa\Desktop\Logitech Sound.vbs"
      My Computer


  3. Posts : 195
    Windows 11 Home
       #3

    a lot of people are saying if yours is doing this it is defective. Amazon has reviews where the speakers dont auto shut off on them, I would just return it. Why pay $300 for something that doesn't work correctly and needs to be messed with to work?
      My Computer


  4. Posts : 22
    Windows 10
    Thread Starter
       #4

    margrave55 said:
    In the "Edit Action" panel, I think the program should be:
    C:\Windows\system32\cscript

    and the arguments should be:
    "C:\Users\richa\Desktop\Logitech Sound.vbs"
    Thanks margrave55 just tried it and it worked.
    Just need to see if it works every hour and change sound to something quieter.

    - - - Updated - - -

    Andrew129260 said:
    a lot of people are saying if yours is doing this it is defective. Amazon has reviews where the speakers dont auto shut off on them, I would just return it. Why pay $300 for something that doesn't work correctly and needs to be messed with to work?
    I didn't read anywhere or on Amazon that it shouldn't be doing this, other forums like Logitech ones are saying they all have this problem and have done stuff like this.

    I also have spoken to Logitech and they say they are all like that if volume is low it switches off after a while unless you have volume higher which isn't pratical on a PC really.

    I admit it does pee me off having to do this and am tempted to return them but not sure what to buy instead.

    - - - Updated - - -

    @Andrew129260 Just to clarify, Logitech have just told me the following...
    According to European regulations, all loudspeakers sold in the EU must have a sleep mode. Z906 also has one. There is no way to adjust the delay before going into sleep mode. Activation normally takes about 20 to 30 minutes if no audio signal is received.

    However in Logitechs wisdom it isn't a sleep mode it turns the power off completely and you have to press on/off button again to get sound back as it dosen't "wake up" when sound is detected again..!

    This isn't required in USA so I guess that is why you don't have this problem Andrew.. good old EU glad we are getting out of it..lol
      My Computer


  5. Posts : 26
    Windows 10 Home ver 21H2, Build 19044.1889
       #5

    margrave55 said:
    In the "Edit Action" panel, I think the program should be:
    C:\Windows\system32\cscript

    and the arguments should be:
    "C:\Users\richa\Desktop\Logitech Sound.vbs"
    I was experiencing the identical problem as the original poster. These edits fixed my problem as well. THANK YOU!

    - - - Updated - - -

    I'm running the same script as the Original Poster. (Source: How do I get Windows 10 to chime / beep on the hour? - Super User)

    Is there any way to stop the cscript.exe window from splashing on the screen every hour, every time the script runs? Or a way to at least minimize it? I went into cscript.exe Properties but didn't see an option to Open Minimized or Run Minimized. If it just popped open using a small piece of real estate in an upper corner of the screen, I would be happy with that. Currently, it consumes almost the whole screen. Thanks!

    Hourly Chime with Task Scheduler-2021_0610-09.01.11-greenshot-008158.png
      My Computer


  6. Posts : 3,234
    Win10
       #6

    I don't know if this will work on that script, but
    instead of
    C:\Windows\system32\cscript.exe
    you can try
    C:\Windows\system32\wscript.exe

    (wscript is the windows gui version of cscript, and unless there is an error or a request for any input, it sould not show anything on the screen, that's the way I understand it).
      My Computers


  7. Posts : 26
    Windows 10 Home ver 21H2, Build 19044.1889
       #7

    das10 said:
    I don't know if this will work on that script, but
    instead of
    C:\Windows\system32\cscript.exe
    you can try
    C:\Windows\system32\wscript.exe

    (wscript is the windows gui version of cscript, and unless there is an error or a request for any input, it sould not show anything on the screen, that's the way I understand it).
    That was beautiful! It works perfectly. It's finally honed to exactly what I wanted. Thank you so much!
      My Computer


  8. Posts : 3,234
    Win10
       #8

    You're welcome.
      My Computers


  9. Posts : 885
    Windows 10 Pro 64bit 22H2 19045.2965
       #9

    mangorunner said:
    Is there any way to stop the cscript.exe window from splashing on the screen every hour, every time the script runs? Or a way to at least minimize it?
    A couple archane things still worth noting about vbscripts that run under the Task Scheduler:

    The console output of cscript.exe CAN be suppressed with the '//nologo' option added to the end of the argument like this:

    "C:\Users\richa\Desktop\Logitech Sound.vbs" //nologo

    The real difference for me between cscript.exe and wscript.exe involves the use of Wscript.Echo commands used for debugging such as:

    Code:
    Wscript.Echo "Debug text goes here"
    With cscript.exe the text goes to the console and can be suppressed.
    However with wscript.exe the text goes to a message box that demands interaction and can't be suppressed.


    Hourly Chime with Task Scheduler-wscriptmessagebox.jpg


    This then presents a problem with wscripts when running under:

    "(●) Run whether user is logged on or not"

    In this scenario the program runs in the background where the message box does not show, and yet the program is waiting for the user to hit the 'OK' button to remove this invisible message box.

    It's just easier for me to use cscript.exe with the //nologo option for scripts that have ongoing 'Wscript.Echo' commands.

    Hourly Chime with Task Scheduler-taskschedrunuseroptions.jpg
      My Computers


 

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

Designer Media Ltd
All times are GMT -5. The time now is 12:02.
Find Us




Windows 10 Forums