Introduction: Text to Speech Batch Program

About: I enjoy anything to do with computers. I have made some interesting scripts, and I am constantly improving my skill set. One day I hope to become a programmer, although in what category is still a mystery (al…

As I promised earlier, I have made this instructable. This is part of a set of instructables I am making that focuses around one of the original features in my Mega_Menu V 2.4 batch program. I have one other, previously made instructable on my address book program which you can find here

This program has one major function only, making your computer "speak" whatever you write in the program. This is accomplished by creating a separate (temporary) VBs file that makes SAPI speak whatever you write. This file is deleted afterwards. 

Onto the code:

Note: I made a mistake, don't use underscores, use hyphens. I have corrected this.

Step 1:

@echo off
title Text to Speech Conversion
color 0a

rem The user decides what to convert here
:input
cls
echo What do you want the computer to convert into speech?
echo.
set /p text=

rem Making the temp file
:num
set num=%random%
if exist temp%num%.vbs goto num
echo ' > "temp%num%.vbs"
echo set speech = Wscript.CreateObject("SAPI.spVoice") >> "temp%num%.vbs"
echo speech.speak "%text%" >> "temp%num%.vbs"
start temp%num%.vbs
pause
del temp%num%.vbs
goto input


If you do not want the screen to close for no reason, I suggest you follow the tip given and don't use spaces; use hyphens (-) instead.

Step 2:

That's it. I don't know why I added this last step, but all the cool-kids are doing it nowadays. Have fun?

P.S It said I needed more photos, so I gave Instructables a cheetah.