Search found 3 matches
- 03 Feb 2021 08:01
- Forum: DOS Batch Forum
- Topic: Edit bat file to parse strings and send output to file
- Replies: 3
- Views: 3570
Re: Edit bat file to parse strings and send output to file
Never mind, I just use Powershell commands to edit the file to show previous line.
- 02 Feb 2021 17:32
- Forum: DOS Batch Forum
- Topic: Edit bat file to parse strings and send output to file
- Replies: 3
- Views: 3570
Re: Edit bat file to parse strings and send output to file
Thanks. I added this line ahead of the For stuff: >results.txt ( <the rest of the stuff> ) PAUSE That created the output file just fine. But I want to refince the output to only show the ones that failed, the two lines like this: [+] Pinging: 172.17.219.133 [FAILED] So that I have in the file a list...
- 02 Feb 2021 12:49
- Forum: DOS Batch Forum
- Topic: Edit bat file to parse strings and send output to file
- Replies: 3
- Views: 3570
Edit bat file to parse strings and send output to file
Hi all, I have a batch file that pings a list of IP addresses. I need to send only the failed pings to a file. Here's the batch file: @Echo OFF For /F "Usebackq Delims=" %%# in ( "List.txt" ) do ( Echo+ Echo [+] Pinging: %%# Ping -n 1 "%%#" 1>nul && ( Echo [OK]) || ( Echo [FAILED]) ) Pause&Exit The ...