Solved

Windows Batch File - Combing output in a single line

Posted on 2016-09-19
3
50 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
3 Comments
 
LVL 68

Accepted Solution

by:
Qlemo earned 500 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
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…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now