Check windows uptime stats w/ Uptime.exe

There is a very useful Windows command that Microsoft didn’t include in any version of windows but should have.  This is the uptime command.  There is a knowledge base article here.  It was released back in the Windows NT days, but still works on all current versions of windows.  I have found this to be an easy way to find out the uptime of the windows servers I maintain without have to log on to the box.


To install just download uptime.exe and place it in the windows directory.  Then run it from the command line.

uptime /? will give a listing of all the options and uptime /help will give detailed instructions.

UPTIME, Version 1.01
(C) Copyright 1999, Microsoft Corporation
Uptime [server] [/s ] [/a] [/d:mm/dd/yyyy | /p:n] [/heartbeat] [/? | /help]
server  Name or IP address of remote server to process.
/s  Display key system events and statistics.
/a  Display application failure events (assumes /s).
/d:  Only calculate for events after mm/dd/yyyy.
/p:  Only calculate for events in the previous n days.
/heartbeat  Turn on/off the system's heartbeat
/? Basic usage.
/help  Additional usage information.

Uptime works by checking the windows event logs for startup and shutdown times.  Running uptime with the /s switch will provide more detailed statistics as shown below.  If the event log has been cleared or is corrupted uptime will not show correct stats.

I have found it helpful to set up .bat files with the servers I want to check. This then gives me a quick list of the uptime of various servers.  It is quite a useful command.  I’m not sure why Microsoft didn’t just stick it in the directory with all their other commands.

C:\uptime \\myserver -s
Uptime Report for: \\myserver
Current OS: Microsoft Windows Server 2003, Service Pack 2, Multiprocessor Free.
Time Zone: Eastern Daylight Time
System Events as of 6/6/2008 9:59:47 AM:
Date:      Time:        Event:               Comment:
---------- -----------  -------------------  -----------------------------------
12/2/2007  1:18:11 PM   Shutdown
12/2/2007  1:20:14 PM   Boot                 Prior downtime:0d 0h:2m:3s
12/4/2007  10:45:19 PM  Shutdown             Prior uptime:2d 9h:25m:5s
12/4/2007  10:47:23 PM  Boot                 Prior downtime:0d 0h:2m:4s
12/16/2007  9:23:16 PM  Shutdown             Prior uptime:11d 22h:35m:53s
12/16/2007  9:25:30 PM  Boot                 Prior downtime:0d 0h:2m:14s
3/1/2008  10:51:12 PM   Shutdown             Prior uptime:76d 1h:25m:42s
3/1/2008  10:54:05 PM   Boot                 Prior downtime:0d 0h:2m:53s
3/16/2008  5:04:48 PM   Shutdown             Prior uptime:14d 17h:10m:43s
3/16/2008  5:07:07 PM   Boot                 Prior downtime:0d 0h:2m:19s
4/9/2008  7:00:38 PM    Shutdown             Prior uptime:24d 1h:53m:31s
4/9/2008  7:02:47 PM    Boot                 Prior downtime:0d 0h:2m:9s
4/9/2008  7:23:35 PM    Shutdown             Prior uptime:0d 0h:20m:48s
4/9/2008  7:25:47 PM    Boot                 Prior downtime:0d 0h:2m:12s
Current System Uptime: 57 day(s), 14 hour(s), 34 minute(s), 44 second(s)
--------------------------------------------------------------------------------
Since 12/2/2007:
  System Availability: 99.9941%
  Total Uptime: 186d 19h:25m:42s
  Total Downtime: 0d 0h:15m:54s
  Total Reboots: 7
  Mean Time Between Reboots: 26.69 days
  Total Bluescreens: 0

7 Responses to “Check windows uptime stats w/ Uptime.exe”


  1. 1 frank

    Yeah, the example outputs here are a bit wider than my blog theme. I am hoping to roll out a new theme which will be wider, but since I am not a designer or good with css at all, it could be a while.

  2. 2 PSmith

    I have used this for a very long time and am now having some challenges with getting it to work on Windows 2008 server w/64bit hardware. Have you run into that? I have seen a couple other folks that have experienced this, but have not seen any resolution. It only occurs if you try to use any of the switches, which is exactly what I want to do.

  3. 3 frank

    I tried this on a 64-bit 2008 server and it seemed to work fine. I know that the event log was changed around a bit in 2008 so that may be part of the problem.

  4. 4 Flipse

    I was completly forgotten this little program. Thanks to google and your blog I wil use it again,

    Thanks.

    Frans

  5. 5 David Barry

    Also having challenges with getting uptime /p:x to work for checking reboot events for Windows 2008 servers. It works for some, not for others, not clear yet what the difference is.

  6. 6 Ike

    Has anyone found a solution to running uptime.exe with parameters on 2008×64? I’m still struggling :(

  1. 1 KanManDet.Dk » Uptime - when was a server restarted

Leave a Reply