我已经创建了这个代码,当我输入一些文本到 username
和 yearsoflife
时要在 .txt file
中导出文本时我不能这样做 .
@echo off
color 0a
echo.
echo.
echo Please insert the following
echo.
echo.
echo.
set /p username=name:
set /p yearsoflife=age:
%username% > name.txt
%yearsoflife% > yourage.txt
1 回答
这是一个可能的解决方案:
你的问题不是那么清楚;您引用了一个文本文件中的两个变量内容 . 所以,为此你可以尝试(加倍
>
符号):注意:更改
set /p username=name:
行只是为了不将此username
变量与username
环境变量混淆!