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

Variables 批处理中两个或多个变量的换行符,variables,batch-file,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.

我有一段代码:

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

这些都不管用。

嗯,你已经在各自的行上写了它们…@Joey他们都在日志文件中,我想知道你是否可以使用变量和
进行响应。所以日志文件是HTML文件,你想插入
br
元素吗?不,它会将
%ip\u address%
%hostname%
的值打印到屏幕上,并且只将
%duration%
打印到文件上。如果要同时重定向多个命令,则需要使用括号