批处理中两个或多个变量的换行符

时间:2015-03-27 22:14:53

标签: variables batch-file

我有这段代码:

echo %ip_address%>%logfile%
echo %hostname%>>%logfile%
echo %duration%>>%logfile%

但是,我想知道是否可以在一个单独的行上回显每个变量。

我尝试了以下内容:

 echo %ip_address% && %hostname% && %duration%>c:\text.txt
 echo %ip_address% & echo.%hostname% & echo.%duration%>c:\text.txt

这些都不起作用。

0 个答案:

没有答案