批处理如何将变量输出到文本?

来源:百度知道 编辑:UC知道 时间:2024/05/30 10:05:36
如以下例子:
set /p tel=请输入电话号码
echo %tel% >> c:\tel.log

好像不行哦。什么地方出错了?

楼主,帮你测试了,可以啊:
@echo off
set /p tel=请输入电话号码
echo %tel% >> c:\tel.log
start "" "c:\tel.log"

没问题。

我的可以啊 就是这样写啊

为什么加那么多引号及空格呢?看我的:

@echo off
set /p tel=请输入电话号码:
echo %tel%>c:\tel.log
start c:\tel.log