我正在试图找出如何添加换行符,以便echo命令逐行打印每台计算机的输出。
FOR %%X IN ("pc1", "pc2",) DO for /F "tokens=2 delims= " %%A in ('qwinsta /server:%%X ^| find "Active"') do (echo %%X %%A Active) >> c:\temp\pcinfo.html
由于
PS:修改:
@echo off
break > c:\temp\hdinfo.html
echo ^<html^> >> c:\temp\hdinfo.html
echo ^<body style="width:500px; margin:0 auto;"^> >> c:\temp\hdinfo.html
echo ^<font size="6"^> >> c:\temp\hdinfo.html
echo ^<font color="#0f0af0"^> >> c:\temp\hdinfo.html
FOR %%X IN ("pc1", "pc2", "pc3", "pc4",) DO for /F "tokens=2 delims= " %%A in ('qwinsta /server:%%X ^| find "Active"') do (
echo %%X %%A ^<font color="#ff0af0"^> Active ^</font^>
) >> c:\temp\hdinfo.html
"c:\program files\internet explorer\iexplore.exe" c:\temp\hdinfo.html
exit
答案 0 :(得分:0)
您可以将echo.
用于回显空行。或者这样做SET NEWLINE=^& echo.
喜欢
SET NEWLINE=^& echo.
FOR %%X IN ("pc1", "pc2",) DO for /F "tokens=2 delims= " %%A in ('qwinsta /server:%%X ^| find "Active"') do (echo "%NEWLINE%^ %%X %%A Active" ) >> c:\temp\pcinfo.html