【发布时间】:2014-05-15 20:42:53
【问题描述】:
echo.
set /p textfileName=What would you like the file to be named?
echo.
echo On the line below, write what text you would like the file to contain:
echo.
set /p textfileContents=
echo %textfileWrite% >> %textfileWriteName%.txt
echo.
echo Your file has been created and is in the same directory as this batch file.
echo It is named %textfilename%.txt
echo.
goto inputCommand
每当我尝试使用此代码时,它都会显示“Echo is off”(来自文件中先前的 @echo off),但不是用户输入的内容。然后,如果我在同一个实例中再次运行它,它将创建上一个文件,但不会创建我刚刚告诉它创建的文件。
我试过 > 但没用,>> 也没用。
【问题讨论】: