Try this.
Main Topics
Browse All TopicsHi everyone.
This is probably a really easy one.
Id like to use psuptime (from sysinternals) to read a list of computer names from a text file called computers.txt and to produce an output file called uptime.txt
By itself, psuptime does the following.
psuptime \\<computer_name>
What id like to do is to create a script that has the following syntax:
<script>.bat or <script.vbs> psuptime computers.txt uptime.txt
The output of running psuptime is:
C:\>psuptime
PsUptime v1.1 - system uptime utility for Windows NT/2K
by Mark Russinovich
Sysinternals - www.sysinternals.com
This computer has been up for 4 days, 9 hours, 17 minutes, 3 seconds.
So, what id like the format of the uptime.txt to be is as follows:
==========================
<computer_name>: This computer has been up for 4 days, 9 hours, 17 minutes, 3 seconds.
<computer_name>: This computer has been up for 1 days, 2 hours, 34 minutes, 56 seconds.
<computer_name>: This computer has been up for 56 days, 10 hours, 2 minutes, 9 seconds.
etc etc
Any help greatly appreciated.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi Amazing,
Mate this works great.
There's only one thing in the output file (uptime.txt) which I think shouldnt be there :>)
If the name of the file to read is "computers.txt", it sees the file "computers.txt" as a computer to poll. See the last line below :>)
==========================
s-14b9608b0: \\s-14b9608b0 has been up for 0 days, 12 hours, 13 minutes, 7 seconds.
ab-23483 This computer was not on.
computers.txt: This computer was not on.
Amazing...sorry still issues.
This is the script im using........
up.bat computers.txt
output when run is:
simon-14b9608b0: Was not able to get status of this computer.
test: This computer was not on.
Tthe thing is though that the ping part works when pinging simon-14b9608b0
And the output of psuptime \\simon-14b9608b0 is:
\\simon-14b9608b0 has been up for 1 day, 3 hours, 51 minutes, 57 seconds.
Hi Amazing.....your last post works great.
The only thing is that i want to hide output when run from the command line.
I successfully did this with the >NULL, but it creates a file called "null" on my system.
Is there a way to hide output and NOT create a file called "null" (or any file for that matter)?
Business Accounts
Answer for Membership
by: canaliPosted on 2009-01-28 at 01:03:28ID: 23484645
try this
bye Gastone
Select allOpen in new window