loading
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
I would justlike to ask to me: is there a way to give it conversational abilities? For example: <br>Context:<br>Computer: Shall I open youtube? <br>Person: yes.<br>Computer: Ok.I will open youtube.<br><br>Context:<br>Computer:Want me to check the weather?<br>Person: Yes.<br>Computer:Ok.I will open youtube.<br><br>The actual question: Can I have EdEN (Thats what I call mine) say different things based on their context?
<p>Although giving such a system conversational and contextual intelligence would be extremely difficult and complicated, it's certainly not impossible. I would certainly plan out exactly how you want EdEN to parse sentences because it's unrealistic to assume you can just make AI. I'd suggest using some of the VBS string features to search what the user says for key words and then go on from there. Please reply if I didn't quite answer your question. </p>
<p>Actually its Not I wrote one You teach as you go the more you interact the greater the conversational ability making its response decisions based on a mood degree deterimined by the interaction with it. you teach it what to say by whats being said to it and whether its good or bad. just like a child. </p>
<p>If some of you are interested in coding their ows personal assistant, here an example of a program I made using Python: </p><p><a href="https://l.facebook.com/l.php?u=https%3A%2F%2Fgithub.com%2FValentinGenard%2FJarvis-artificial-intelligence&h=CAQEHEyBE" rel="nofollow">https://github.com/Valenti.../Jarvis-artificial-intelligence</a></p><p>It is coded in a structured way so that you can easily understaind and modify the code for your own needs, you need basic python knowledge.<br>Hoping that will help someone ;)</p>
Could i get this to work on a phone?
<p>No web page is opening....pls help</p>
<p>No web page is opening....pls help</p>
<p>how do i open a game with this.When i try to do that an error appears which tells that 'THE SYSTEM CANNOT FIND THE FILE SPECIFIED'.I am running windows xp</p>
<p>how would you make the system automatically accept a command if it is a known command. With it the way it is now, you say the command, but then have to hit enter. I want to be able to say google and it process it right away without hitting enter.</p>
Saying &quot;ok&quot; can also advance the script if I recall correctly. You may also be able to look into an API for speech recognition in visual basic script. Back when I wrote this, I wasn't aware of that option, but if I were to try and rewrite this, I would probably use the API. In short, there isn't an easy way that comes to mind to solve your issue, but more advanced methods might be able to.
<p>how can you ge tthis to run in a website</p>
<p>You would probably want to do something similar to what's described here.</p><p>http://www.csidata.com/custserv/onlinehelp/vbsdocs/vbs9.htm</p>
Thanks but could you specify where do we save those programs
Since this script doesn't need anything else to run in it's original state, it doesn't need to be saved anywhere specifically. Just save it where it's easily accessible for the sake of convenience.
What's winkey<br>
<p>The key with the windows logo on it. If you're still having trouble opening notepad, you can usually just search it in the start menu.</p>
Can i write this program in c++? And if so, can you give me example on it.
Theoretically, yes as the structure will carry over into an if statement in C++, however I don't have the experience with C++ to actually write this program, since I'm unfamiliar with the syntax. The biggest problem you might face in converting this code would be finding an equivalent to SAPI. More information can probably be found though a quick Google search. Sorry I was unable to give a direct answer, but best of luck with the conversion.
Thanks Super_Nerd
What is language you used for writing this code?
<p>VBS or Visual Basic Script.</p>
<p>Hey Super_Nerd</p><p>I am sort of new at VBScript and I can't quite determine what is wrong with my code, could you please help with it?</p><p>Thanks</p><p>-HAX0RF7W</p><p>Here it is</p><p>I added and changed the code a little so it is not the same as yours.</p><p>-----------------------------------------------------------------------------------------</p><p>Set Sapi = Wscript.CreateObject(&quot;SAPI.SpVoice&quot;)<br>set wshshell = wscript.CreateObject(&quot;wscript.shell&quot;)<br><br>dim Input<br><br>wshshell.run &quot;%windir%\Speech\Common\sapisvr.exe -SpeechUX&quot;<br>Sapi.speak &quot;Hello, I am Name, Your assistant. What is your name?&quot;<br><br>message=InputBox (&quot;Hello, I am Name, what's your name?&quot;)<br>sapi.speak &quot;Hello&quot;<br>sapi.Speak message<br><br>sapi.speak &quot;I can open Youtube, Instructables, Google, Command Prompt, Notepad, or Calculator for you&quot;<br>sapi.speak &quot;What would you like me to open?&quot;<br>sapi.Speak message<br><br>do<br>message=inputbox (&quot;What would you like me to open for you?&quot;)<br><br>if Input = &quot;youtube&quot; OR Input = &quot;Youtube&quot; OR Input = &quot;Sandie open youtube&quot; OR Input = &quot;Open youtube&quot; then<br>Sapi.speak &quot;I am currently opening youtube for you&quot;<br>wshshell.run &quot;www.youtube.com&quot;<br><br>else<br>if Input = &quot;notepad&quot; OR Input = &quot;Notepad&quot; OR Input = &quot;Sandie open notepad&quot; OR Input = &quot;Open notepad&quot;then<br>Sapi.speak &quot;I am currently opening notepad for you&quot;<br>wshshell.run &quot;notepad&quot;<br><br>else<br>if Input = &quot;instructables&quot; OR Input = &quot;Instructables&quot; OR Input = &quot;Sandie open instructables&quot; OR Input = &quot;Open instructables&quot; then<br>Sapi.speak &quot;I am currently opening instructables for you&quot;<br>wshshell.run &quot;www.instructables.com&quot;<br><br>else<br>if Input = &quot;google&quot; OR Input = &quot;Google&quot; Or Input =&quot;Sandie open google&quot; Or Input = &quot;Open Google&quot; then<br>Sapi.speak &quot;I am currently opening google for you&quot;<br>wshshell.run &quot;www.google.com&quot;<br><br>else<br>if Input = &quot;command prompt&quot; OR Input = &quot;Command prompt&quot; Or Input = &quot;Sandie open command prompt&quot; Or Input = &quot;Open command prompt&quot; Or Input = &quot;cmd&quot; Or Input = &quot;CMD&quot; Or Input = &quot;Sandie open cmd&quot; Or Input = &quot;Open cmd&quot; then<br>Sapi.speak &quot;I am currently opening command prompt for you&quot;<br>wshshell.run &quot;cmd&quot;<br><br>else<br>if Input = &quot;calculator&quot; OR Input = &quot;Calculator&quot; Or Input = &quot;Sandie open calculator&quot; Or Input = &quot;Sandie open the calculator&quot; Or Input = &quot;Sandie open my calculator&quot; Or Input = &quot;Sandie open calc&quot; Or input = &quot;Open calculator&quot; Or Input = &quot;Open the calculator&quot; Or Input = &quot;Open calc&quot; then<br>Sapi.speak &quot;I am currently opening calculator for you&quot;<br><br>else<br>if Input = &quot;&quot; then<br>else<br><br><br>Sapi.speak &quot;I couldn't quite understand you Name, please repeat that.&quot;<br>end if<br>end if<br>end if<br>end if<br>end if<br>end if<br>end if<br><br>loop while 1&lt;2</p><p>---------------------------------------------------------------------------------------------------</p><p>Thanks again, respond as soon as you can</p><p>no rush</p>
<p>Could you please specify if this is an error that doesn't let your script run, or is this just your script not working properly. I'll get to testing this soon, but if you could tell me what I'm looking for that would be helpful. :)</p>
<p>Do any of you know the vbscript to get your computer to tell you the weather? What I mean by this is by the vbs fetching the weather forecast from yahoo weather or the weather channel, and then saying it using Sapi.speak?</p>
<p>Although I've never worked with it, I believe there is an HTTP API. You'd have to fetch the text of a web page and then using string functions parse it into the format you want. This may help:</p><p>http://stackoverflow.com/questions/204759/http-get-in-vbs</p>
<p>how can i programming my assistant to turn on/off the wifi?</p>
<p>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:</p><p>Set Sapi = Wscript.CreateObject(&quot;SAPI.SpVoice&quot;)<br>set wshshell = wscript.CreateObject(&quot;wscript.shell&quot;)<br><br>dim Input<br><br>wshshell.run &quot;%windir%\Speech\Common\sapisvr.exe -SpeechUX&quot;<br>Sapi.speak &quot;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?&quot;<br>Input=inputbox (&quot;Hello Iane! What can I do for you?&quot;)<br><br><br>do<br><br><br>if Input = &quot;youtube&quot; OR Input = &quot;Youtube&quot;then<br>Sapi.speak &quot;Opening youtube&quot;<br>wshshell.run &quot;www.youtube.com&quot;<br><br>else<br>if Input = &quot;instructables&quot; OR Input = &quot;Instructables&quot; then<br>Sapi.speak &quot;Opening instructables&quot;<br>wshshell.run &quot;www.instructables.com&quot;<br><br>else<br>if Input = &quot;google&quot; OR Input = &quot;Google&quot; then<br>Sapi.speak &quot;Opening google&quot;<br>wshshell.run &quot;www.google.com&quot;<br><br>else<br>if Input = &quot;command prompt&quot; OR Input = &quot;Command prompt&quot; then<br>Sapi.speak &quot;Opening command prompt&quot;<br>wshshell.run &quot;cmd&quot;<br><br>else<br>if Input = &quot;calculator&quot; OR Input = &quot;Calculator&quot; then<br>Sapi.speak &quot;Opening calculator&quot;<br>wshshell.run &quot;calc&quot;<br><br>else<br>if Input = &quot;notepad&quot; OR Input = &quot;Notepad&quot; then<br>Sapi.speak &quot;Opening notepad&quot;<br>wshshell.run &quot;notepad&quot;<br><br>else<br>if Input = &quot;&quot; then<br>else<br><br><br>Sapi.speak &quot;I don't recognize your input, Please try something else&quot;<br>end if<br>end if<br>end if<br>end if<br>end if<br>end if<br>end if<br><br>loop</p>
<p>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.</p><p>Set Sapi = Wscript.CreateObject(&quot;SAPI.SpVoice&quot;)</p><p>set wshshell = wscript.CreateObject(&quot;wscript.shell&quot;)</p><p>dim Input</p><p>wshshell.run &quot;%windir%\Speech\Common\sapisvr.exe -SpeechUX&quot;</p><p>Sapi.speak &quot;Greetings Ian, my name is Athos. I am going to be your personal assistant and I shall tend to all your needs.&quot;</p><p>do </p><p>Sapi.speak &quot;How may I help you?&quot;</p><p>Input=inputbox (&quot;Hello Iane! What can I do for you?&quot;)</p><p>if Input = &quot;youtube&quot; OR Input = &quot;Youtube&quot;then</p><p>Sapi.speak &quot;Opening youtube&quot;</p><p>wshshell.run &quot;www.youtube.com&quot;</p><p>elseif Input = &quot;instructables&quot; OR Input = &quot;Instructables&quot; then</p><p>Sapi.speak &quot;Opening instructables&quot;</p><p>wshshell.run &quot;www.instructables.com&quot;</p><p>elseif Input = &quot;google&quot; OR Input = &quot;Google&quot; then</p><p>Sapi.speak &quot;Opening google&quot;</p><p>wshshell.run &quot;www.google.com&quot;</p><p>elseif Input = &quot;command prompt&quot; OR Input = &quot;Command prompt&quot; then</p><p>Sapi.speak &quot;Opening command prompt&quot;</p><p>wshshell.run &quot;cmd&quot;</p><p>elseif Input = &quot;calculator&quot; OR Input = &quot;Calculator&quot; then</p><p>Sapi.speak &quot;Opening calculator&quot;</p><p>wshshell.run &quot;calc&quot;</p><p>elseif Input = &quot;notepad&quot; OR Input = &quot;Notepad&quot; then</p><p>Sapi.speak &quot;Opening notepad&quot;</p><p>wshshell.run &quot;notepad&quot;</p><p>elseif Input = &quot;&quot; then</p><p>Sapi.speak &quot;Goodbye&quot;</p><p>else</p><p>Sapi.speak &quot;I don't recognize your input, Please try something else&quot;</p><p>end if</p><p>loop until Input = &quot;&quot;</p>
<p>This is great! Now I just need it to have it talk back and understand in JAVIS voice. I can live in nerd heaven, that and I need it to build me titanium flight suits. </p>
<p>Hmm, although I can't suggest how to make the computer respond like a human would, you could always have it attached to a 3d printer. Hehe.</p>
<p>I've got a question, after hitting enter the program disappears and starts your asked program/ webpage. But is it possible to let the program stay there so you can enter a new command?</p>
<p>Yes. Just put a line with 'do' right before the first one that starts with Sapi.Speak. Then put a line with 'loop' at the very end of the program. I hope this helps.</p>
great.. I think I gonna edit the 'else' &amp; 'endif' a lot to do my assistant work better
Great. Feel free to post your code up here.
This is cool thanks for the info about the speech program on windows 7 im using right now i would suggest adding more programs to the personal assistant I added a Internet shortcut a game or two and a movie but still working on getting it to work it seems when it goes through the wshshell.run part it does not conect to the stuff i added and sugestions? <br> <br>thanks bigmikedog :D
Did you make sure you had quotation marks around the shortcuts?<br><br>Tell me the error that you get.
here is the the code im useing Set Sapi = Wscript.CreateObject(&quot;SAPI.SpVoice&quot;) <br>set wshshell = wscript.CreateObject(&quot;wscript.shell&quot;) <br> <br>dim Input <br> <br>wshshell.run &quot;%windir%\Speech\Common\sapisvr.exe -SpeechUX&quot; <br>Sapi.speak &quot;Please speak, or type, what you want to open?&quot; <br>Input=inputbox (&quot;Please speak, or type, game for games, command prompt for cmd, site list for sitegoto, calculator for the calculator, notepad for notpad, log_me_out for shutdown options, or close to close the program&quot;) <br> <br>if Input = &quot;Site list&quot; OR Input = &quot;site list&quot;then <br>Sapi.speak &quot;loading site list&quot; <br>wshshell.run &quot;C:\Users\Michael\Desktop\bat games\sitegoto.bat&quot; <br> <br>else <br>if Input = &quot;Game&quot; OR Input = &quot;game&quot; then <br>Sapi.speak &quot;loading game list&quot; <br>wshshell.run &quot;C:\Users\Michael\Desktop\bat games\games.bat&quot; <br> <br>else <br>if Input = &quot;command prompt&quot; OR Input = &quot;Command prompt&quot; then <br>Sapi.speak &quot;Opening command prompt&quot; <br>wshshell.run &quot;cmd&quot; <br> <br>else <br>if Input = &quot;calculator&quot; OR Input = &quot;Calculator&quot; then <br>Sapi.speak &quot;Opening calculator&quot; <br>wshshell.run &quot;calc&quot; <br> <br>else <br>if Input = &quot;notepad&quot; OR Input = &quot;Notepad&quot; then <br>Sapi.speak &quot;Opening notepad&quot; <br>wshshell.run &quot;notepad&quot; <br> <br>else <br>if Input = &quot;log_me_out&quot; OR Input = &quot;log me out&quot; then <br>Sapi.speak &quot;starting log me out&quot; <br>wshshell.run &quot;C:\Users\Michael\Desktop\bat games\log-out.bat&quot; <br> <br>else <br>if Input = &quot;close&quot; then <br>Sapi.speak &quot;Goodby Michael&quot; <br> <br>else <br>Sapi.speak &quot;I don't recognize your input, Please try something else&quot; <br>end if <br>end if <br>end if <br>end if <br>end if <br>end if <br>end if <br> <br>when i type in game it says the right thing but then it gives me this error mesage &quot; line 17 chariter 1 (witch is the wshshell.run code bit) Error the system cannot find the file specified&quot; <br>thanks -bigmikedog
Sorry it took so long to reply. Try just putting games.bat in the same folder assistant.vbs is in. Then instead of <br><br>C:\Users\Michael\Desktop\bat games\games.bat<br><br>put<br><br>games.bat

About This Instructable

64,776views

42favorites

License:

Bio: 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."
More by Super_Nerd:Make an assistant for your computer in 5 minutes Track Computer Usage in 2.5 minutes How to be a MAD Scientist! MU-AH HA HA HA! 
Add instructable to: