XP/2K/2003: View uptime of Windows system

Contributor Icon Contributed by qmchenry Date Icon August 29, 2004  
Tag Icon Tagged: Windows

Want to know how long it has been since a Windows system was booted?


Using the following command will show the uptime of the system as well as other information:

net statistics workstation

Look for a line such as this near the top of the output:

Statistics since 8/27/2004 10:34 PM

Previous recipe | Next recipe |
 
  • davak
    Are you saying that your way of getting uptime is better than mine?

    :wink:

    davak
  • davak
    Sample Output:

    <ul id="quote">Workstation Statistics for \TECHIE


    Statistics since 8/18/2004 4:48 PM


    Bytes received 1351749
    Server Message Blocks (SMBs) received 11320
    Bytes transmitted 1398661
    Server Message Blocks (SMBs) transmitted 11318
    Read operations 184
    Write operations 0
    Raw reads denied 0
    Raw writes denied 0

    Network errors 0
    Connections made 866
    Reconnections made 5
    Server disconnects 861

    Sessions started 0
    Hung sessions 0
    Failed sessions 0
    Failed operations 2
    Use count 1711
    Failed use count 7

    The command completed successfully.</ul>
  • qmchenry
    Oh, hmm. Yeah, your way is a little better because it shows the actual uptime and doesn't require mental algebra (and knowledge of what day it is, which I generally lack). Your way generates lots of extra stuff I wouldn't want to see. I really wish Windows had more command line tools like (ahem) UNIX so I could pipe it to grep and pull out the uptime line...
  • davak
    <ul id="quote"><h6>qmchenry wrote:</h6>Oh, hmm. Yeah, your way is a little better because it shows the actual uptime and doesn't require mental algebra (and knowledge of what day it is, which I generally lack). Your way generates lots of extra stuff I wouldn't want to see. I really wish Windows had more command line tools like (ahem) UNIX so I could pipe it to grep and pull out the uptime line...</ul>

    And THAT'S why Monad/MSH will rock so much. It has all of those filtering tools built-in.

    Davak
  • Anonymous
    Use

    systeminfo | find "System Up Time"

    which will do the "grep" for you.
  • spanky
    ... or you could just use the system up time counter, and have things logged to file at a predefined interval, without having to manually type a command every time you what an update.
  • ace
    this is excellent
    thank u
  • why start counting the days use the command systmeinfo and it will show you everything you really need.
blog comments powered by Disqus