Batch to create an ping and tracert log

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Dasmius
Posts: 21
Joined: 02 Mar 2022 13:47

Batch to create an ping and tracert log

#1 Post by Dasmius » 11 Jul 2022 06:24

Supp guys,

I need some help to create an batch file that colect ping and tracert info form some IP's in a txt filer. And I have no idea how to do it, can anyone help me with?

Thx ppl!

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Batch to create an ping and tracert log

#2 Post by ShadowThief » 11 Jul 2022 09:05

Just stick a >>file.txt after each command to add the output to file.txt.

Code: Select all

ping google.com >>file.txt
tracert google.com >>file.txt
You can also stick the redirection in front of the command.

Code: Select all

>>file.txt ping google.com
>>file.txt tracert google.com
You can also use parentheses if you don't want to type so much.

Code: Select all

>>file.txt (
	ping google.com
	tracert google.com
)

Dasmius
Posts: 21
Joined: 02 Mar 2022 13:47

Re: Batch to create an ping and tracert log

#3 Post by Dasmius » 11 Jul 2022 12:00

Got it, I'l try it.

Thx bro ^^

Post Reply