0

I'm trying to figure out how to add a line break so the echo command prints the output for each computer line by line.

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

Thanks

PS: modified:

@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
jeb
  • 78,592
  • 17
  • 171
  • 225
Sam Kamran
  • 33
  • 1
  • 6

1 Answers1

0

You can put echo. to echo empty lines. or do this SET NEWLINE=^& echo. Like

    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
Regie Baguio
  • 241
  • 5
  • 13