• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 109
  • Last Modified:

Windows Batch File - Combing output in a single line

Hi there,

I am looking for a way to combine both output lines in a single line, and without using the FOR command.

I remember a long time ago, I think paultomasi or billprew did this but I don`t remember how.

Thanks and cheers,

PING -n 1 | FINDSTR /i "statistics packets"
PING /w 5000 /n 1 >NUL 2>&1

Open in new window

1 Solution
QlemoBatchelor and DeveloperCommented:
You remember half way correct. Suppressing the carriage return works only for string literals or variable substitution, but not for command results (hint: set /p ,=Text to display<nul).
You'll need the FOR, sorry. Or use an external tool. Or use PowerShell, which is my recommendation.
ReneGeAuthor Commented:
Thanks mate :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now