如何在特定文件夹内创建文本文件,并在其中包含信息和批处理文件?

时间:2018-11-20 05:24:13

标签: batch-file

对于上下文,我正在尝试制作一个AI批处理文件,该文件可以学习并记住所有花哨的内容。 我真的在让它存储信息方面有问题。我当前的代码工作正常,但是每当要存储其中带有空格的问题时,它就会开始将问题放入答案中。请帮忙。

:base 
set /p ch=:
goto :bank 

:bank 
if exist %ch%.txt goto :Reply 
goto :learn 

:learn 
echo AI: I'm sorry, I don't know what,"%ch%" means.
echo Is this a question? Y/N
CHOICE /c:YN /n >NUL
if errorlevel 2 goto :continue 
goto :questionconfirmedlearn 
:questionconfirmedlearn
cls 
echo AI: About what? Please be brief. A topic like cars is what i'm looking 
for as an answer.  
set /p what=:
echo AI: And what would be the answer?
set /p answer=:
echo AI: I thank you for quenching my thirst for knowledge. 
pause 
cls 
mkdir %~dp0\questions\%what%
echo %answer%>%~dp0\questions\%what%\%ch%.txt
echo questions>%ch%.txt
goto :base     

0 个答案:

没有答案