Computing.Net > Forums > Programming > Scripting question?

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.

Scripting question?

Reply to Message Icon

Name: frank819
Date: July 28, 2009 at 06:00:59 Pacific
OS: Windows XP
Product: Microsoft Administering windows xp pro
Subcategory: Batch
Comment:

I'm trying to use the contents of a text file to import to Excel.

echo %computername%
systeminfo -s \\%computername% |Find "Up Time" >> \\servername\\Uptime\%computername%.txt

Currently the challenge is
the information posts on 2 lines

computer name
System Uptime

I want it to look like this roughly

computer name System uptime



Sponsored Link
Ads by Google

Response Number 1
Name: Judago
Date: July 28, 2009 at 07:25:29 Pacific
Reply:

Maybe this will help:

(
    SET /P =%computername% <NUL
    2>NUL systeminfo -s \\%computername% |Find "Up Time"
) >> \\servername\\Uptime\%computername%.txt

If you only want elements from the uptime fields you will need to run it through a for /f loop.


0

Response Number 2
Name: frank819
Date: July 28, 2009 at 07:38:08 Pacific
Reply:

Excellent that works perfectly thanks

Frank


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


about programming Variables from CSV



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: Scripting question?

script question www.computing.net/answers/programming/script-question/12620.html

scripting question www.computing.net/answers/programming/scripting-question/8089.html

Scripting question www.computing.net/answers/programming/scripting-question/3931.html