Make an Assistant for Your Computer in 5 Minutes

116,508

63

67

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

9 People Made This Project!

Recommendations

  • Edible Art Challenge

    Edible Art Challenge
  • Paint Challenge

    Paint Challenge
  • Tiny Things Speed Challenge

    Tiny Things Speed Challenge

67 Comments

0
777programmer
777programmer

8 months ago

My assistant didn't work?? I put all of what u had put to my assistant's coding ,but when i go to open it...There's a message coming,


Image20210304202155.png
0
gumbleforlife12
gumbleforlife12

Reply 3 months ago

yes the code that works is different from the one on the instructions but even that opens it again and again

0
777programmer
777programmer

Reply 8 months ago

So then, how can i make it??

0
gumbleforlife12
gumbleforlife12

Question 3 months ago on Step 7

Great code and it works fine, just it won't stop opening the URL for example if I put in YouTube then every second it will open another YouTube page and never stop unless I restart how do I fix?

0
samcharles290
samcharles290

Question 3 months ago on Step 8

To run other file I have used the file path but still it doesn't run that application why? please anybody answer.

0
neelavybhavi148
neelavybhavi148

Question 6 months ago

I need help in running how do you do it

0
kartikbhat0523
kartikbhat0523

Question 6 months ago

My assistant didn't work?? I put all of what u had put to my assistant's coding ,but when i go to open it...There's a message coming,

16198048541458784398857587920498.jpg
0
jhicks30
jhicks30

Question 1 year ago

How can you change the voice?

0
aimaker_3222
aimaker_3222

Answer 8 months ago

copy paste the below lines after the first two lines in notepad

Dim msg, sapi

Set sapi = createObject("sapi.spvoice")

Set sapi.Voice = sapi.GetVoices.Item(1)

0
jhicks30
jhicks30

Question 1 year 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
aimaker_3222
aimaker_3222

Answer 8 months ago

yes you can change the voice, just copy paste the below lines in notepad after the first two lines
Dim msg, sapi

Set sapi = createObject("sapi.spvoice")

Set sapi.Voice = sapi.GetVoices.Item(1)

0
sangita.midya76
sangita.midya76

1 year 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 1 year ago

How do you get the voice commands to work?

0
Shiham Khan
Shiham Khan

1 year 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

1 year ago

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

0
iane.tabor
iane.tabor

6 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 6 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 1 year 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.