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
0

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you. I modified the script a little. to output into a html file. can you please advise how to achieve this on html?
I fixed it by adding ^<br^> to echo .

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.