创建优先不运行的代码

时间:2017-10-06 07:01:47

标签: batch-file cmd

您好我正在尝试为我的学校学生共享文件夹创建一个聊天系统但是我在显示用户已经推算的文本时遇到了一些麻烦

在向聊天系统输入任何文本之前,它看起来像这样

@echo off
set Text=2

:StartHere
cls
goto StartOfText

:AddNewText
set /p Desc=
echo :%Text: =% >> "%~F0"
echo echo %Desc% >> "%~F0"
set /a Text=%Text%+1
goto StartHere

:StartOfText
echo Welcome to the Chat Box
echo.

:EndOfText
goto AddnewText

但在我输入文字后,它看起来像这样

@echo off
set Text=2

:StartHere
cls
goto StartOfText

:AddNewText
set /p Desc=
echo :%Text: =% >> "%~F0"
echo echo %Desc% >> "%~F0"
set /a Text=%Text%+1
goto StartHere

:StartOfText
echo Welcome to the Chat Box
echo.

:EndOfText
goto AddnewText


:2 
echo This is a test 
:3 
echo This is another test 
:4 
echo and another test 

如何更改代码,以便:2,:3和:4之间创建:StartOfText和:EndOfText

0 个答案:

没有答案