?
Solved

Windows Batch File - Combing output in a single line

Posted on 2016-09-19
3
Medium Priority
?
100 Views
Last Modified: 2016-09-20
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,
Rene

@ECHO OFF
:Home
PING -n 1 192.168.1.1 | FINDSTR /i "statistics packets"
PING 192.168.11.0 /w 5000 /n 1 >NUL 2>&1
GOTO Home

Open in new window

0
Comment
Question by:ReneGe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 71

Accepted Solution

by:
Qlemo earned 2000 total points
ID: 41805242
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.
0
 
LVL 10

Author Closing Comment

by:ReneGe
ID: 41805308
Thanks mate :)
Cheers
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question