Finding Uptime for Windows

I’ve been happily using my little Pentium 2 Windows 2000 experiment for the past week and am happy to say it is working quite well.  About the only real tweaking I’ve done so far is to drop a custom Firefox build onto it.

I suppose I should plan to run through the BlackViper Win2k Service tuning guide soon though.  That might free up a bit more memory.

Today I realized that the little laptop has been running all week — I became curious about the actual uptime.  The *nix users know all about the uptime command, but it’s not something you find on your Windows machine.  For those, I’ve traditionally gone and found a 3rd party program to display it.  However, it turns out Microsoft can offer several ways to do this…

The Basic Way

According to Microsoft KB 555737, there are already commands built into most Windows versions that can be used to determine uptime.  For my Windows 2000 laptop, that command (typed in a command prompt) is:

net stats srv

For the XP machines, this one works:

net statistics server

In either case, there’s a line towards the top of the output that starts, “Statistics since” that lists the date/time of the last startup.

The “Less Math” Way

Don’t want to calculate the uptime yourself? KB 232243 offers the Microsoft update program.  Download and toss it somewhere in the path (like your windows directory).  Bring up a command prompt, type “uptime” and revel in the results.

uptime.exe output

The Network Way

Here’s another method, assuming your computer is on a LAN.  Check the adapter properties:

Uptime the Network Way

For XP, that’d be Start -> Connect To… and then select Show all Connections.  Double click your active adapter and check the properties. Kind of low-rent, but looks pretty accurate (the two images here are both from the same machine, you can calculate roughly how long it took me to write that last few paragraphs!)

Wrap Up

For my purposes any of these options work just fine.  Any know any other low-tech/simple ways to get uptime off a Windows machine?  Do Macs have the uptime command or are there interesting tips for those as well? Share!

Possibly Related posts:

  1. Windows Installer CleanUp Utility to the Rescue
  2. Windows 7 Beta
  3. Moving the My Documents Folder
  4. Windows Command Line Completion
  5. Another Windows vs. Linux Decision


16 comments to Finding Uptime for Windows

  • Online Dress Up Games

    Interesting… but what’s the purpose of finding out your uptime?

    Just for fun?

    Thanks for the info anyways!

  • Dave B

    I just make sure I have a copy of psinfo from System Internals on a machine. It’d be nice if there was something built in, but PSinfo is a nice little downloadable command line tool.
    (http://www.microsoft.com/technet/sysinternals/default.mspx)

    And if you want bragging rights, I have a win2k server thats been up about 3 years and 2 months now. Its amazing the uptime you get out of a Windows box that doesn’t do anything.

  • 3 years! Dang… I’m in awe.

  • Dave B

    1168 days as of this morning. I keep thinking I should just decommission the thing and be done with it, but part of me is curious to see just how long it’ll keep running. Its actually survived 3 power outages because its the last box left on that UPS.

  • Dave, that’s rather impressive. It must not be service-packed? I had to reboot all my win2k server boxes again this past week with the latest updates.

    Is it exposed, or just on the LAN chugging away?

  • Dave B

    Its servicepacked to SP4, but when I setup WSUS it got left out of the Group Policy so it doesn’t get patched.

    Its on the LAN, but not exposed at all. I’d hesitate to say it even is chugging away because its role was done away with when we did the last round of server upgrades.

  • Dave, that’s fun stuff. Go for 2000 days!

  • Dave B

    Unfortunately I won’t be able to. My POC at the client just resigned, and they terminated the contract at the end of the month(Consolidation and what not, this was the only location left that we serviced and they wanted everyone under one contract..my POC refused to switch but once she was gone…so were we.)

    I’ll have to grab a psinfo of it just before we go though, just so I can say I’ve seen a server up that long.

  • TheGingerbreadman

    Turns out typing

    systeminfo | find “Up Time”

    at a command line is a nice and neat way of getting the info too. Only 8 days here and feels like it’s overdue for a flush but then it IS actually doing something 24/7… lol

  • Dave B

    Oh nice…I’d never thought of using system info like that. It does appear that its about twice as fast as PSinfo too.

  • TGB – That’s just brilliant!

    I tried it on Vista, but no “Up Time” reported anymore (?). Works great on the Win2k and XP boxes I tried though :-)

  • TheGingerbreadman

    I don’t have Vista myself so can’t check, but I’m told that you just need to change the search phrase to “Boot Time” instead of “Up Time”. So type

    systeminfo | find “Boot Time”

    instead on a Vista box. Don’t know why they changed it. Apparently they no longer work it out for you either and just show the date, leaving you to do the maths yourself. Yikes lol. That’s the new and improved version for you….. :-D

    If that doesn’t work just type systeminfo on its own and see what’s still available then search for the appropriate section title or whatever next time. They must still have something along that line. They couldn’t have improved it right out of the software surely….. :-P

  • @TGB I think that they did indeed “improve it out” of the software. LoL!

    But as you mentioned, boot time will at least get it started.

  • ComradeHaz

    Hi guys, think for vista this way wins.

    # Get Task Manager up. (You can hit CTRL+SHIFT+ESC to get to it amongst the other obvious ways.)
    # In Task Manager, select the Performance tab.
    # The current system uptime is shown under System near the bottom.

    ATB,
    Haz

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>