Computing.Net > Forums > Programming > Batch File Scripting

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.

Batch File Scripting

Reply to Message Icon

Name: ccyre
Date: December 3, 2008 at 08:38:45 Pacific
OS: XP
CPU/Ram: 3.0 2
Product: hp
Comment:

Hey there this might be rehash sorry.

Need a batch file to use a command I have called uptime.exe against a list of servers (server.txt) and sent the results to results .txt

example

uptime (variable that looks in servers.txt) sends result to results.txt

Then does it again for the next server in the servers.txt until finished.

Thanks in advance.



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: December 3, 2008 at 08:51:10 Pacific
Reply:

Assuming that uptime.exe writes to stdout and can thus be redirected:

============================================
for /f "tokens=* delims= " %%a in (server.txt) do (
uptime.exe %%a >> results.txt
)


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: ccyre
Date: December 3, 2008 at 13:41:29 Pacific
Reply:

This worked like a champ. You rock thanks again.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


batch extract words from ... Java and Concept Maps



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: Batch File Scripting

Batch file script www.computing.net/answers/programming/batch-file-script/17513.html

Small batch file/scripting program www.computing.net/answers/programming/small-batch-filescripting-program/2353.html

XP Batch File www.computing.net/answers/programming/xp-batch-file/14933.html