Make an Assistant for Your Computer in 5 Minutes

105,844

57

58

Introduction: Make an Assistant for Your Computer in 5 Minutes

About: I find a quote from Bill Gates makes a very good description. "Be nice to nerds. Chances are you'll end up working for one."

Heard of the new iPhone 4S with Siri? In under an hour I made one for windows in VBS. Now I can open youtube just by saying "youtube OK"
or search google by saying "google OK" Get prepared for making your own new form of using your computer.

You will need

-Windows Vista and up Machine (if you want voice activation. if not windows 98 or higher)
-5 minutes
-Microphone (If you want voice activation)

Step 1: Setup Speech Recognition

If you want to use speech recognition with this follow these instructions. If not, skip to step two.

Go to

Control Panel>Ease Of Access>Speech Recognition>Train your computer to better understand you

Follow the directions that it gives you and read the text aloud.

Step 2: Open Notepad

Press Winkey + R

Type in "notepad"

Hit enter

Step 3: Copy This Script Into Notepad (voice Activation)

Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
set wshshell = wscript.CreateObject("wscript.shell")

dim Input

wshshell.run "%windir%\Speech\Common\sapisvr.exe -SpeechUX"
Sapi.speak "Please speak, or type, what you want to open?"
Input=inputbox ("Please speak, or type, what you want to open.")





if Input = "youtube" OR Input = "Youtube"then
Sapi.speak "Opening youtube"
wshshell.run "www.youtube.com"

else
if Input = "instructables" OR Input = "Instructables" then
Sapi.speak "Opening instructables"
wshshell.run "www.instructables.com"

else
if Input = "google" OR Input = "Google" then
Sapi.speak "Opening google"
wshshell.run "www.google.com"

else
if Input = "command prompt" OR Input = "Command prompt" then
Sapi.speak "Opening command prompt"
wshshell.run "cmd"

else
if Input = "calculator" OR Input = "Calculator" then
Sapi.speak "Opening calculator"
wshshell.run "calc"

else
if Input = "notepad" OR Input = "Notepad" then
Sapi.speak "Opening notepad"
wshshell.run "notepad"

else
if Input = "" then
else


Sapi.speak "I don't recognize your input, Please try something else"
end if
end if
end if
end if
end if
end if
end if

Step 4: Copy This Script Into Notepad (no Voice Activation)

Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
set wshshell = wscript.CreateObject("wscript.shell")

dim Input

Sapi.speak "Please type, what you want to open?"
Input=inputbox ("Please type, what you want to open.")





if Input = "youtube" OR Input = "Youtube"then
Sapi.speak "Opening youtube"
wshshell.run "www.youtube.com"

else
if Input = "instructables" OR Input = "Instructables" then
Sapi.speak "Opening instructables"
wshshell.run "www.instructables.com"

else
if Input = "google" OR Input = "Google" then
Sapi.speak "Opening google"
wshshell.run "www.google.com"

else
if Input = "command prompt" OR Input = "Command prompt" then
Sapi.speak "Opening command prompt"
wshshell.run "cmd"

else
if Input = "calculator" OR Input = "Calculator" then
Sapi.speak "Opening calculator"
wshshell.run "calc"

else
if Input = "notepad" OR Input = "Notepad" then
Sapi.speak "Opening notepad"
wshshell.run "notepad"

else
if Input = "" then
else


Sapi.speak "I don't recognize your input, Please try something else"
end if
end if
end if
end if
end if
end if
end if

Step 5: Test the Script

Now save the script as assistant.vbs

Once the file has been saved run it, and it should tell you its ready for a command.

Say one of the options and then say OK.

It should open that option.

Step 6: Personalization

You can replace a chunk of code in here to open something else fairly easy. Lets start with one of the chunks, lets say, calculator.

else
if Input = "calculator" OR Input = "Calculator" then
Sapi.speak "Opening calculator"
wshshell.run "calc"

Say I want this to open bing.com

You have to change 4 parts.

else
if Input = "HERE" OR Input = "HERE" then
Sapi.speak "HERE"
wshshell.run "HERE"

The first one must be all lowercase. bing
The second one has a capital first letter Bing
The third is sapi speaking so something like Opening Bing
The fourth is the target www.bing.com


So it would look like this

else
if Input = "bing" OR Input = "Bing" then
Sapi.speak "Opening bing"
wshshell.run "www.bing.com"

!! Make sure everything has quotation marks around it or else it will be considered a variable not a text string!!

In case you were wondering why there was a capital and lowercase bing, it was so the program would recognize two common ways bing is written (with or without capitalization).



Step 7: Save and Test Again

Now that you have set the program to your liking, you can save it and run again. Test anything you set yourself to make sure it works. If it works move on. If it doesn't check your spelling or retry.  

Step 8: Yay!

Now that you have a shortcut program you can open youtube with two words. Get to google by speaking. This is very useful and fun to show to your friends. I don't want to see any comments saying "you could just use run" because you obviously didn't read through, since run doesn't automaticaly run sapi or speak after you open it. Anyways, thanks for reading.

                                                                                                                             Super_Nerd

7 People Made This Project!

Recommendations

  • Battery Powered Contest

    Battery Powered Contest
  • Plywood Challenge

    Plywood Challenge
  • Plastic Contest

    Plastic Contest

58 Discussions

0
sangita.midya76
sangita.midya76

4 months ago

How can I make my assistant to open any other program other than which was written in the code below:
Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
set wshshell = wscript.CreateObject("wscript.shell")

dim Input

Sapi.speak "Please type, what you want to open?"
Input=inputbox ("Please type, what you want to open.")





if Input = "youtube" OR Input = "Youtube"then
Sapi.speak "Opening youtube"
wshshell.run "www.youtube.com"

else
if Input = "instructables" OR Input = "Instructables" then
Sapi.speak "Opening instructables"
wshshell.run "www.instructables.com"

else
if Input = "google" OR Input = "Google" then
Sapi.speak "Opening google"
wshshell.run "www.google.com"

else
if Input = "command prompt" OR Input = "Command prompt" then
Sapi.speak "Opening command prompt"
wshshell.run "cmd"

else
if Input = "calculator" OR Input = "Calculator" then
Sapi.speak "Opening calculator"
wshshell.run "calc"

else
if Input = "notepad" OR Input = "Notepad" then
Sapi.speak "Opening notepad"
wshshell.run "notepad"

else
if Input = "" then
else


Sapi.speak "I don't recognize your input, Please try something else"
end if
end if
end if
end if
end if
end if
end if

0
Jacko676
Jacko676

Question 6 weeks ago

How do you get the voice commands to work?

0
jhicks30
jhicks30

Question 3 months ago

I love this program!! Just 2 questions..
1) Can I change the voice?
2) How do i make it, lets say instead open my requests in microsoft edge, can open in firefox?

0
Shiham Khan
Shiham Khan

5 months ago

Really cool stuff bro!
But my question is how do I change the voice
And also for some reason, this code isn't working just tell me what's wrong
Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
set wshshell = wscript.CreateObject("wscript.shell")
dim Input
wshshell.run "%windir%\Speech\Common\sapisvr.exe -SpeechUX"
Sapi.speak "Hello Im FRIDAY, your virtual assistant. So How are you Shiham.Hope you are all well! I can do many things for you, just name it! "
Input = inputbox ("So what can I do for you!")
Sapi.speak Input
wshshell.run Input
elseif
Input = "good Morning FRIDAY" OR Input = "Good Morning FRIDAY" then
Sapi.speak "Good morning Sir. Sunday is Science, Hindi, S.S.T, English, Maths, Maths, Monday is Science, Hindi, p.e.d, Math, English, S.S.T,Tuesday is Science, Hindi, S.S.T, English, Maths, K.S.S, Wednesday is Science, Hindi, S.S.T, Maths, English, Arabic, Thursday is Science, Hindi, Math, English, S.S.T, Dance. Hove thi sinfo helps you."

0
Orion Morris
Orion Morris

5 months ago

HI I can't wait to do this when I get my new computer so thanks super_nerd!

0
iane.tabor
iane.tabor

5 years ago on Introduction

Hi Super_Nerd! This was the best! I am so excited going home from school everyday so just I can add more codes for my A.I. Thank you very much! But... I had one problem: I did what you told JoshuaS3 but it backfired. Maybe I did something wrong? Here check my codes:

Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
set wshshell = wscript.CreateObject("wscript.shell")

dim Input

wshshell.run "%windir%\Speech\Common\sapisvr.exe -SpeechUX"
Sapi.speak "Greetings Ian, my name is Athos. I am going to be your personal assistant and I shall tend to all your needs. How may I help you?"
Input=inputbox ("Hello Iane! What can I do for you?")


do


if Input = "youtube" OR Input = "Youtube"then
Sapi.speak "Opening youtube"
wshshell.run "www.youtube.com"

else
if Input = "instructables" OR Input = "Instructables" then
Sapi.speak "Opening instructables"
wshshell.run "www.instructables.com"

else
if Input = "google" OR Input = "Google" then
Sapi.speak "Opening google"
wshshell.run "www.google.com"

else
if Input = "command prompt" OR Input = "Command prompt" then
Sapi.speak "Opening command prompt"
wshshell.run "cmd"

else
if Input = "calculator" OR Input = "Calculator" then
Sapi.speak "Opening calculator"
wshshell.run "calc"

else
if Input = "notepad" OR Input = "Notepad" then
Sapi.speak "Opening notepad"
wshshell.run "notepad"

else
if Input = "" then
else


Sapi.speak "I don't recognize your input, Please try something else"
end if
end if
end if
end if
end if
end if
end if

loop

0
Super_Nerd
Super_Nerd

Reply 5 years ago on Introduction

Hi. I tested your program out. I kind of wished you told me what exactly happened. (although fighting with it myself was kind of funny) Your error was that you didn't put the inputbox in the loop. Looking back, the instructions in that comment were a little vague. Sorry for the confusion. I switched your code up to fix the issue and also make it more efficient. (I originally wrote this 3 years ago) Try copying this. If you select cancel or give it a blank input, it should abort from the program.

Set Sapi = Wscript.CreateObject("SAPI.SpVoice")

set wshshell = wscript.CreateObject("wscript.shell")

dim Input

wshshell.run "%windir%\Speech\Common\sapisvr.exe -SpeechUX"

Sapi.speak "Greetings Ian, my name is Athos. I am going to be your personal assistant and I shall tend to all your needs."

do

Sapi.speak "How may I help you?"

Input=inputbox ("Hello Iane! What can I do for you?")

if Input = "youtube" OR Input = "Youtube"then

Sapi.speak "Opening youtube"

wshshell.run "www.youtube.com"

elseif Input = "instructables" OR Input = "Instructables" then

Sapi.speak "Opening instructables"

wshshell.run "www.instructables.com"

elseif Input = "google" OR Input = "Google" then

Sapi.speak "Opening google"

wshshell.run "www.google.com"

elseif Input = "command prompt" OR Input = "Command prompt" then

Sapi.speak "Opening command prompt"

wshshell.run "cmd"

elseif Input = "calculator" OR Input = "Calculator" then

Sapi.speak "Opening calculator"

wshshell.run "calc"

elseif Input = "notepad" OR Input = "Notepad" then

Sapi.speak "Opening notepad"

wshshell.run "notepad"

elseif Input = "" then

Sapi.speak "Goodbye"

else

Sapi.speak "I don't recognize your input, Please try something else"

end if

loop until Input = ""

0
pkprosenjeet
pkprosenjeet

Reply 6 months ago

I don't run another apps of windows such as Notepad , Calculator , CMD .
I want to run another apps of windows in this program.
Please solved this problem and send the coding.

0
jhicks30
jhicks30

Question 6 months ago

How can you change the voice?

0
shaiknuru05
shaiknuru05

Question 10 months ago on Step 7

Hi, Thanks for sharing this with us. it is awesome.

can you please help me to put the below options.
1. I would like to have this input prompt always visible on my screen.(I do not have voice input)
2. Want to open multiple URLs by a single input(For example if i type open chrome it should open Google and youtube).
3. want to open putty and login to the Linux servers without prompting for the password(want to give Ip address, username, and password in the script itself)
it should work like this, for example, I have server "ABC" with IP address "10.7.8.9"
user name "abc" and password "xyz".

I would like to give input as ABC and it should login to the server and it should check for java process(ps -ef | grep java).

0
shaiknuru05
shaiknuru05

Answer 10 months ago

i'm able to open multiple URLs.

1
Power921
Power921

1 year ago

Hi I am power
instead type this in notepad and save it as .vbs
*********************************************************************************************************************
Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
set wshshell = wscript.CreateObject("wscript.shell")

dim Input

Sapi.speak "Please type, what you want to open?"
Input = inputbox ("Please type, what you want to open.")
Sapi.speak Input
wshshell.run Input
*********************************************************************************************************************

0
Hasdk
Hasdk

Question 1 year ago

How can I add any type of abilities to my assistant

0
IRONCARNAGE
IRONCARNAGE

Question 1 year ago

Hello, is it necessary to enable speech recognition for voice command control?

0
daren.lurkins
daren.lurkins

Question 1 year ago on Step 5

Why does it always say “Undeterminated string constant”?

0
achyutdesai7
achyutdesai7

Question 2 years ago

my lapi is showing an error to run this program please solve it

0
Alen Biju
Alen Biju

3 years ago

My question my be silly(I am a 9th Grader).....How to run this program and will this work in Bluej Java .Please help me out. I typed like this in the notepad but i cannot run it

Set Sapi = Wscript.CreateObject("SAPI.SpVoice")

set wshshell = wscript.CreateObject("wscript.shell")

dim Input

wshshell.run "%windir%\Speech\Common\sapisvr.exe -SpeechUX"

Sapi.speak "Please speak, or type, what you want to open?"

Input=inputbox ("Please speak, or type, what you want to open.")

if Input = "youtube" OR Input = "Youtube"then

Sapi.speak "Opening youtube"

wshshell.run "www.youtube.com"

else

if Input = "instructables" OR Input = "Instructables" then

Sapi.speak "Opening instructables"

wshshell.run "www.instructables.com"

else

if Input = "google" OR Input = "Google" then

Sapi.speak "Opening google"

wshshell.run "www.google.com"

else

if Input = "command prompt" OR Input = "Command prompt" then

Sapi.speak "Opening command prompt"

wshshell.run "cmd"

else

if Input = "calculator" OR Input = "Calculator" then

Sapi.speak "Opening calculator"

wshshell.run "calc"

else

if Input = "notepad" OR Input = "Notepad" then

Sapi.speak "Opening notepad"

wshshell.run "notepad"

else

if Input = "" then

else

Sapi.speak "I don't recognize your input, Please try something else"

end if

end if

end if

end if

end if

end if

end if