We have already seen how to make Windows welcome us with an audio voice message during logon. Using the same commands, we will see how to make Windows 11/10/8/7 tell us the time every hour. This can be especially useful if you tend to lose track of time while working.
Make Windows speak out the time
- First, open Notepad and copy-paste the following:
Dim speaks, speech speaks=hour(time) Set speech=CreateObject("sapi.spvoice") speech.Speak speaks
- Save it as a .vbs file. If you wish, you can download the ready-to-use file by clicking here.
- Next, type schedule tasks in search and click on the schedule tasks result, to open the Task Scheduler.
- Under Action, select Create Task. Give the task a name. I have given it SpeakTime.
- Set the Trigger parameters as shown in the image. One time – Start date & time, Repeat task every 1 hour, Duration – Indefinitely, and so on.
- Under Actions, click the New button. The New Action box will open. Select the Action — Start a program and browse the vbs file to set the path.
- You may change some parameters under the Conditions and Settings tabs – otherwise, you may leave them at their defaults.
- Click OK and Exit.
Now, every hour, Windows or Microsoft David will speak out the time to you…11…12…! If you don’t like Microsoft David, you may opt to hear the voice of Microsoft Hazel or Microsoft Zira instead via Control Panel > Text to Speech tab under Speech Properties.
You can also make Windows talk to you.
Does Windows show screen time?
Yes, it is possible to see the screen time, but you will need to use the Battery section for that. Go to Settings > System > Power and battery > Battery usage. Switch to the 7-day or 24-hour filter, and it will show the total screen time and battery time consumed by each app.
How to set screen time limits in Windows?
There are a few ways to set screen time limits on Windows. You can use the Microsoft Family Safety app, the Settings app, or the Command Prompt. The last one uses the net user <username> /times:<days,times> to set the time limit for each user.
Awesome tutorial!
I modified this one a bit to say “It is x o’clock AM/PM” (converted to 12-hour clock instead of the default 24 hour). Also made it say “ten” instead of “one zero”.
————Here’s my version of the script————
Dim speaks, speech
hour_now=hour(time)
if hour_now > 12 Then
hour12 = hour_now – 12
ampm = “PM”
Else
hour12 = hour_now
hourfinal = hour_now
ampm = “AM”
End If
If hour12 = 10 Then
hourfinal = “Ten”
Elseif hour12 = 11 Then
hourfinal = “Eleven”
Elseif hour12 = 12 Then
hourfinal = “Twelve”
Elseif hour12 = 0 Then
hourfinal = “Twelve”
Elseif hour12 > 0 and hour12 < 10 Then
hourfinal = hour12
End If
speaks = "It is " & hourfinal & " o clock " & ampm
Set speech=CreateObject("sapi.spvoice")
speech.Speak speaks
Awesome tutorial!
I modified this one a bit to say “It is x o’clock AM/PM” (converted to 12-hour clock instead of the default 24 hour). Also made it say “ten” instead of “one zero”.
————Here’s my version of the script (fixed)————
Dim speaks, speech
hour_now=hour(time)
if hour_now > 12 or hour_now = 12 Then
hour12 = hour_now – 12
ampm = “PM”
Else
hour12 = hour_now
hourfinal = hour_now
ampm = “AM”
End If
If hour12 = 10 Then
hourfinal = “Ten”
Elseif hour12 = 11 Then
hourfinal = “Eleven”
Elseif hour12 = 12 Then
hourfinal = “Twelve”
Elseif hour12 = 0 Then
hourfinal = “Twelve”
Elseif hour12 > 0 and hour12 < 10 Then
hourfinal = hour12
End If
speaks = "It is " & hourfinal & " o clock " & ampm
Set speech=CreateObject("sapi.spvoice")
speech.Speak speaks
That’s even better, then. Thanks for sharing! :)
I forgot to mention you can switch the commented out lines and have it say “O’Clock” as well.
Damn, I have been using this (script below in previous post) for more than a year and it always said “ten” properly. I just built a new PC this past week and only an hour ago imported the script from my old PC. I had been running the original RTM version of Windows 8.0. A few days ago I bought a brand new copy of Windows 8.1 Pro from Best Buy and now my script says “one-zero” at ten O’clock like some of you have mentioned. When I saw others mention this I thought to change the time and try it for the first time on my new PC. Here is a fixed version. Use the XML script in my earlier post to import into task Scheduler to automatically create the task. Again, place both files in your User Home directory (i.e. C:UsersCharlie)
‘ CurrentHour.vbs
Dim speaks, speech
Set speech=CreateObject(“sapi.spvoice”)
If Hour(Time)=0 Then
‘ speech.Speak “It is twelve o’clock A M”
speech.Speak “It is twelve A M”
ElseIf Hour(Time)=10 Then
‘ speech.Speak “It is ten o’clock P M”
speech.Speak “It is ten P M”
ElseIf Hour(Time)=12 Then
‘ speech.Speak “It is twelve o’clock P M”
speech.Speak “It is twelve P M”
ElseIf Hour(Time)12 Then
‘ speech.Speak “It is ” & Hour(Time) Mod 12 & ” o’clock P M”
speech.Speak “It is ” & Hour(Time) Mod 12 & “P M”
End If
After running this newer script for nearly a day on my new PC build I noticed it now pronounces all the double-digit hours incorrectly. Repairing the “10” was not enough. There is a distinct difference between the older Windows 8 and the newer Windows 8.1 in how this works. Leave it to Microsoft to screw things up. I’ve been a heavy Windows user since Version Beta 1.0 back in the 1980’s. Microsoft has a knack for shooting themselves and others in the foot. So much for my elegant code.
Last time. (I hope)
———————-
‘ CurrentHour.vbs
Dim speaks, speech
Set speech=CreateObject(“sapi.spvoice”)
If Hour(Time)=0 Then
‘ speech.Speak “It is twelve o’clock A M”
speech.Speak “It is twelve A M”
ElseIf Hour(Time)=10 Then
‘ speech.Speak “It is ten o’clock A M”
speech.Speak “It is ten A M”
ElseIf Hour(Time)=11 Then
‘ speech.Speak “It is eleven o’clock A M”
speech.Speak “It is eleven A M”
ElseIf Hour(Time)=22 Then
‘ speech.Speak “It is ten o’clock P M”
speech.Speak “It is ten P M”
ElseIf Hour(Time)=23 Then
‘ speech.Speak “It is eleven o’clock P M”
speech.Speak “It is eleven P M”
ElseIf Hour(Time)=12 Then
‘ speech.Speak “It is twelve o’clock P M”
speech.Speak “It is twelve P M”
ElseIf Hour(Time)12 Then
‘ speech.Speak “It is ” & Hour(Time) Mod 12 & ” o’clock P M”
speech.Speak “It is ” & Hour(Time) Mod 12 & “P M”
End If
Question: I followed the directions for windows 8 and set it to follow the task every 15 minutes. But now every 15 minutes a pop up comes up saying “How would you like to open this file?”, so its not pronouncing it automatically :( it only does when I click on the file. How do I get this to work? Thanks
Check if you have followed this tutorial correctly. Ensure that scripting is enabled. Ensure .vbs file is set to open with default Windows Script Host. https://www.thewindowsclub.com/windows-script-host-access-is-disabled-on-this-machine
Thank you. I double checked that I followed the instructions and now when I selected that it open using the Microsoft Windows Script Host I get a pop up saying “the program you have selected cannot be associated with this file type. please choose another program” what should I try now?
same thing with me
Same here. Did you fix it?! then can tell me
It’s not working did everything like you posted
if i set every half and hour it’s not announcing the 30. how do i fix that?!! can you help pls
There you go:
I used aguynamedruchir’s script, made some changes to tell any time, set it at any interval.
—-Script—-
Dim speaks, speech
hour_now=hour(time)
min_now=Minute(time)
if hour_now > 12 or hour_now = 12 Then
hour12 = hour_now – 12
ampm = “PM”
Else
hour12 = hour_now
hourfinal = hour_now
ampm = “AM”
End If
If hour12 = 10 Then
hourfinal = “Ten”
Elseif hour12 = 11 Then
hourfinal = “Eleven”
Elseif hour12 = 12 Then
hourfinal = “Twelve”
Elseif hour12 = 0 Then
hourfinal = “Twelve”
Elseif hour12 > 0 and hour12 < 10 Then
hourfinal = hour12
End If
speaks = "It's " & hourfinal & " " & min_now & " " & ampm
Set speech=CreateObject("sapi.spvoice")
speech.Speak speaks
Hi I’ve been using this script for months and it’s been good. However, I’d like to make 2 changes.
One is, is there anyway I can add adjusting volume in the script? Lowering system volume didn’t work.
Also, is it possible to add quiet hours in the script? It would be nice to stop speaking time at after 12 am.
Please let me know. Thanks.
I have a problem
Whenever it’s time to speak it doesn’t.
It just open a windows that says “How do you want to open this file” and it gives the option to choose between several apps
and it also happens when I click on the .VBS file
But when I right click the .VBS file and choose “”open with command prompt” it works just fine and says the time
This was great help, thanks so much.
I made a JS version, works same with some enhancements:
AM/PM, 12 hours. Excludes minutes if 00 and midnight or noon.
var v = new ActiveXObject("Sapi.SpVoice");
var voices = v.GetVoices();
v.Voice = voices.Item(1);
var d = new Date();
var H = d.getHours();
var m = d.getMinutes();
var text;
switch (H) {
case 00:
{
text = "Midnight";
break;
}
case 12:
{
text = "Noon";
break;
}
default:
{
var ap;
if (H > 12) {
ap = "PM";
H -= 12;
}
else {
ap = "AM";
}
if ( m 0 )
m = "o " + m;
text = m == 00 ? H + " " + ap : H + " " + m + " " + ap;
}
}
v.Speak(text);
I followed the steps a few weeks ago and all that happens is a window open up that says “How do you want to open this file” and it gives the option to choose between several apps. Only basic options come up and not vbs / script like the other messages on this page. I want to delete the whole thing. I went to task and deleted it but its still popping up every hour and is frustrating. Can someone please tell me how to delete this from my windows computer please. Thanks.
Execute “regsvr32.exe vbscript.dll” in an elevated CMD to re-register the DLL file and see.
To delete, remove the added Task as well as delete the vbs script file.
I am not a IT person so I have no idea what this means! :)
Execute “regsvr32.exe vbscript.dll” in an elevated CMD to re-register the DLL file and see.
Where is the vbs file?
Same issue Anand, can you please suggest a solution.
Right-click on Start Button and select Command Prompt (Admin). Then copy-paste regsvr32.exe vbscript.dll in it and hit Enter.
The vbs script is the one you downloaded from here (or created) and saved on your PC. Delete that file.
You need to add the next code:
with speech
Set .voice = .getvoices.item(0)
.Volume = 100
.Rate = 0
end with
below the line: Set speech=CreateObject(“sapi.spvoice”) it should look like this:
Set speech=CreateObject(“sapi.spvoice”)
with speech
Set .voice = .getvoices.item(0)
.Volume = 1
.Rate = 0
end with
speech.Speak speaks
You need to add the next code:
with speech
Set .voice = .getvoices.item(0)
.Volume = 100
.Rate = 0
end with
below the line: Set speech=CreateObject(“sapi.spvoice”) it should look like this:
Set speech=CreateObject(“sapi.spvoice”)
with speech
Set .voice = .getvoices.item(0)
.Volume = 100
.Rate = 0
end with
speech.Speak speaks
Then change the desired value on >> .Volume = 100 << from 0 to 100 percentage