Want to Generate a Greeting? That Greets You And Informs you the current date and time?


 

Copy the below codes in Notepad

Set Sapi = Wscript.CreateObject(“SAPI.SpVoice”)
dim str
if hour(time) < 12 then
Sapi.speak “Good Morning Tom”                                                                       ‘ Add Your Own Greetings Message.
else
if hour(time) > 12 then
if hour(time) < 20 then
Sapi.speak “Good Evening  Tom”                                                                       ‘ Add Your Own Greetings Message.
else
Sapi.speak “Good Night Tom”                                                                              ‘ Add Your Own Greetings Message.
end if
end if
end if

sapi.speak “The current date is”                                                                          ‘ Add Your Own Time Greetings Message.
sapi.speak date

Sapi.speak “and The time is”                                                                                ‘ Add Your Own Time Greetings Message.
if hour(time) > 12 then
Sapi.speak hour(time)-12
else
if hour(time) = 0 then
Sapi.speak “12”
else
Sapi.speak hour(time)
end if
end if
if minute(time) < 10 then
Sapi.speak “o”
if minute(time) < 1 then
Sapi.speak “clock”
else
Sapi.speak minute(time)
end if
else
Sapi.speak minute(time)
end if
if hour(time) > 12 then
Sapi.speak “P.M.”
else
if hour(time) = 0 then
if minute(time) = 0 then
Sapi.speak “Midnight”
else
Sapi.speak “A.M.”
end if
else
if hour(time) = 12 then
if minute(time) = 0 then
Sapi.speak “Noon”
else
Sapi.speak “P.M.”
end if
else
Sapi.speak “A.M.”
end if
end if
end if

 


And Save it as “filename.vbs”  – any filename with extension “.vbs” (meaning vbscript)

And if u want it to be opened everytime you start your PC then follow the following steps:
Move the file to C:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Example:

Need help? Feel free to comment and get answer.

Leave a Reply