Computing.Net > Forums > Programming > how can I get log file out of this?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how can I get log file out of this?

Reply to Message Icon

Name: amlife
Date: October 8, 2008 at 13:08:27 Pacific
OS: Win2K3
CPU/Ram: 2GB
Product: HP
Comment:

Hello
I have batch file will ping more than one
address, how can I get output for all pings
saved in .txt

================Batch ================
cls
@echo off
echo "All Servers" ping results ..
MD %systemdrive%\"Documents and
Settings"\%USERNAME%\Desktop\Ping_Logs

Ping 10.0.0.20
Ping 10.0.0.38
Ping 10.0.4.10
Ping 10.0.0.9
Ping 10.0.0.76
Ping 10.0.0.21
Ping 10.0.0.78
Ping 10.0.0.10
Ping 10.0.0.3
Ping 10.0.0.7
Ping 10.0.0.86
Ping 10.0.0.22
echo.
set /p see=Ping completed [Enter]exit...
goto again

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: Judago
Date: October 8, 2008 at 14:20:35 Pacific
Reply:

Provided you want them in a single text file:



(Ping 10.0.0.20
Ping 10.0.0.38
Ping 10.0.4.10
Ping 10.0.0.9
Ping 10.0.0.76
Ping 10.0.0.21
Ping 10.0.0.78
Ping 10.0.0.10
Ping 10.0.0.3
Ping 10.0.0.7
Ping 10.0.0.86
Ping 10.0.0.22
)>>newfile.txt


0

Response Number 2
Name: amlife
Date: October 8, 2008 at 14:52:31 Pacific
Reply:

Good, I got it to work with your great help
:)

I was wondering now how can I use %date% with
naming those log files.

Thanks again


0

Response Number 3
Name: Razor2.3
Date: October 8, 2008 at 17:46:57 Pacific
Reply:

FOR /F "tokens=2" %%a IN ("%date%") DO SET log=%%a
SET log=%log:/=.%.txt

. . . .

)>>%log%


0

Response Number 4
Name: amlife
Date: October 9, 2008 at 07:58:40 Pacific
Reply:

works great .. thank you so much.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: how can I get log file out of this?

how can i open .msi file www.computing.net/answers/programming/how-can-i-open-msi-file/18674.html

how can i get just the filename www.computing.net/answers/programming/how-can-i-get-just-the-filename/17474.html

How can I edit this JavaScript??? www.computing.net/answers/programming/how-can-i-edit-this-javascript/8722.html