Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: batch
Okay im updating this it WAS solved but a problem arose
 
Its still not putting the variable in + its not putting all 3 lines of code
 
cd words
@echo off
title SaySpell Editor by Stu. Jayden Serenari
color 3a
:menu
cls
echo   _____                    _____                  _   _ 
echo  / ____!                  / ____!                ! ! ! !
echo ! (___     __ _   _   _  ! (___    _ __     ___  ! ! ! !
echo  \___ \   / _` ! ! ! ! !  \___ \  ! '_ \   / _ \ ! ! ! !
echo  ____) ! ! (_! ! ! !_! !  ____) ! ! !_) ! !  __/ ! ! ! !
echo !_____/   \__,_!  \__, ! !_____/  ! .__/   \___! !_! !_!
echo                    __/ !          ! !                   
echo                   !___/           !_!                   
echo  ______       _   _   _                    _   _        
echo !  ____!     ! ! (_) ! !                  ! ! ! !       
echo ! !__      __! !  _  ! !_    ___    _ __  ! ! ! !       
echo !  __!    / _` ! ! ! ! __!  / _ \  ! '__! ! ! ! !       
echo ! !____  ! (_! ! ! ! ! !_  ! (_) ! ! !    !_! !_!       
echo !______!  \__,_! !_!  \__!  \___/  !_!    (_) (_)   
echo.
echo   1.) Start                     2.)Save old list
set choice=
set /p choice=Number?: 
if %choice%==1 goto start
if %choice%==2 goto save
goto menu
 
:save
cls
set /p listn=List Number: 
md List%listn%
echo Saving....
move word1.dll List%listn%
move word1.vbs list%listn%
move word2.dll List%listn%
move word2.vbs list%listn%
move word3.dll List%listn%
move word3.vbs list%listn%
move word4.dll List%listn%
move word4.vbs list%listn%
move word5.dll List%listn%
move word5.vbs list%listn%
move word6.dll List%listn%
move word6.vbs list%listn%
move word7.dll List%listn%
move word7.vbs list%listn%
move word8.dll List%listn%
move word8.vbs list%listn%
move word9.dll List%listn%
move word9.vbs list%listn%
move word10.dll List%listn%
move word10.vbs list%listn%
move word11.dll List%listn%
move word11.vbs list%listn%
move word12.dll List%listn%
move word12.vbs list%listn%
move word13.dll List%listn%
move word13.vbs list%listn%
move word14.dll List%listn%
move word14.vbs list%listn%
move word15.dll List%listn%
move word15.vbs list%listn%
move word16.dll List%listn%
move word16.vbs list%listn%
move word17.dll List%listn%
move word17.vbs list%listn%
move word18.dll List%listn%
move word18.vbs list%listn%
move word19.dll List%listn%
move word19.vbs list%listn%
move word20.dll List%listn%
move word20.vbs list%listn%
cls
echo Saved!
echo.
echo Press enter to continue
set /p jjj=
goto menu
 
:start
cls
echo Welcome! 
echo.
echo This is based on a twenty word list
echo Press enter to continue
set /p asd=
 
cls
set word=
set /p word=Word 1?: 
echo %word% >> word1.dll
echo speechtext=("%word1%") > word1.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word1.vbs
echo objspeech.speak speechtext >> word1.vbs
cls
 
cls
set word=
set /p word=Word 2?: 
echo %word% >> word2.dll
echo speechtext=("%word2%") > word2.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word2.vbs
echo objspeech.speak speechtext >> word2.vbs
 
cls
set word=
set /p word=Word 3?: 
echo %word% >> word3.dll
echo speechtext=("%word3%") > word3.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word3.vbs
echo objspeech.speak speechtext >> word3.vbs
 
cls
set word=
set /p word=Word 4?: 
echo %word% >> word4.dll
echo speechtext=("%word4%") > word4.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word4.vbs
echo objspeech.speak speechtext >> word4.vbs
 
cls
set word=
set /p word=Word 5?: 
echo %word% >> word5.dll
echo speechtext=("%word5%") > word5.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word5.vbs
echo objspeech.speak speechtext >> word5.vbs
 
cls
set word=
set /p word=Word 6?: 
echo %word% >> word1.dll
echo speechtext=("%word6%") > word1.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word6.vbs
echo objspeech.speak speechtext >> word6.vbs
 
cls
set word=
set /p word=Word 7?: 
echo %word% >> word7.dll
echo speechtext=("%word7%") > word7.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word7.vbs
echo objspeech.speak speechtext >> word7.vbs
 
cls
set word=
set /p word=Word 8?: 
echo %word% >> word8.dll
echo speechtext=("%word8%") > word8.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word8.vbs
echo objspeech.speak speechtext >> word8.vbs
 
cls
set word=
set /p word=Word 9?: 
echo %word% >> word9.dll
echo speechtext=("%word9%") > word9.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word9.vbs
echo objspeech.speak speechtext >> word9.vbs
 
cls
set word=
set /p word=Word 10?: 
echo %word% >> word10.dll
echo speechtext=("%word10%") > word10.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word10.vbs
echo objspeech.speak speechtext >> word10.vbs
 
cls
set word=
set /p word=Word 11?: 
echo %word% >> word11.dll
echo speechtext=("%word11%") > word11.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word11.vbs
echo objspeech.speak speechtext >> word11.vbs
 
cls
set word=
set /p word=Word 12?: 
echo %word% >> word12.dll
echo speechtext=("%word12%") > word12.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word12.vbs
echo objspeech.speak speechtext >> word12.vbs
 
cls
set word=
set /p word=Word 13?: 
echo %word% >> word13.dll
echo speechtext=("%word13%") > word13.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word13.vbs
echo objspeech.speak speechtext >> word13.vbs
 
cls
set word=
set /p word=Word 14?: 
echo %word% >> word14.dll
echo speechtext=("%word14%") > word14.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word14.vbs
echo objspeech.speak speechtext >> word14.vbs
 
cls
set word=
set /p word=Word 15?: 
echo %word% >> word15.dll
echo speechtext=("%word15%") > word15.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word15.vbs
echo objspeech.speak speechtext >> word15.vbs
 
cls
set word=
set /p word=Word 16?: 
echo %word% >> word16.dll
echo speechtext=("%word16%") > word16.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word16.vbs
echo objspeech.speak speechtext >> word16.vbs
 
cls
set word=
set /p word=Word 17?: 
echo %word% >> word17.dll
echo speechtext=("%word17%") > word17.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word17.vbs
echo objspeech.speak speechtext >> word17.vbs
 
cls
set word=
set /p word=Word 18?: 
echo %word% >> word1.dll
echo speechtext=("%word18%") > word18.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word18.vbs
echo objspeech.speak speechtext >> word18.vbs
 
cls
set word=
set /p word=Word 19?: 
echo %word% >> word1.dll
echo speechtext=("%word19%") > word19.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word19.vbs
echo objspeech.speak speechtext >> word19.vbs
 
cls
set word=
set /p word=Word 20?: 
echo %word% >> word20.dll
echo speechtext=("%word20%") > word20.vbs
echo set objspeech=createobject("SAPI.spVoice") >> word20.vbs
echo objspeech.speak speechtext >> word20.vbs
cls
echo The list is now done!
echo.
echo Press enter to exit.
set /p mas=
Posted 31-Jan-13 13:48pm
G4mm4R4y1.1K
Edited 31-Jan-13 14:48pm
v3
Comments
Abhishek Pant at 31-Jan-13 20:46pm
   
i'm confused your updated part is answer or question?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I put the first few lines of your BAT file into a BAT file and executed it. The quotes do appear in the filename.vbs file. I have Windows 8.
 
My BAT file looks like this:
SET /p var=What To Say:
echo speechtext=("%var%") > filename.vbs
echo set objspeech=createobject("SAPI.spvoice") >> filename.vbs
echo objspeech.speak speechtext >> filename.vbs
 
The filename.vbs looks like this:
speechtext=("Hello World") 
set objspeech=createobject("SAPI.spvoice") 
objspeech.speak speechtext 
and when I execute it, I hear the "Hello World"
  Permalink  
v2
Comments
Jaydman2102 at 31-Jan-13 19:36pm
   
See it may have to do with the windows version because mine wold simply say
 
speechtext=("")
set objspeech=createdobject("SAPI.voice")
objspeech.speak speechtext
Jaydman2102 at 31-Jan-13 19:38pm
   
Wait i tried yours and it worked!
 
Thank the heavens!
 
Mike Meinz at 31-Jan-13 19:45pm
   
Please accept the solution to mark the question as answered.
Jaydman2102 at 31-Jan-13 19:48pm
   
I rejected because a new problem was found please if you can remake the code or tell me the error
Mike Meinz at 31-Jan-13 19:59pm
   
You use SET /P to set a parameter named word but you put word1 in the echo speechtext= statement. Same issue for all 20 of them.
 
Please mark the question as answered.
Jaydman2102 at 7-Feb-13 15:58pm
   
I found that before you said that but thanks. I think i did mark it as answered...?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Here is my advice: switch to PowerShell:
http://en.wikipedia.org/wiki/PowerShell[^],
http://technet.microsoft.com/en-US/scriptcenter/dd742419.aspx[^].
 
Not only it has impressive purely scripting syntax, but it provides easy access to all of WMI and the power of .NET. There is absolutely no need to use VBScript or JavaScript with Windows Script Host, but it is also accessible.
 
Moreover, its recent version 3.0 finally provides really decent stepwise debugger and even very good Intellisense.
 
—SA
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 575
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,466
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,897


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100