Project Description
uptime.exe makes it very easy to display the uptime of your PC since last boot. It writes the current time and the uptime (in one line) to the output console.

I needed something similar to the "uptime" terminal program available on Linux for my Windows machine. But I do not need the additional information of "system load average" or "count of users" displayed by the Linux "uptime".
All I need is a pain and straight string containing my PC's uptime written to the std output.

So here it is:
run uptime.exe from your command promt and it prints the following line:

current time uptime [days,] time since last boot

with:
  • current time formated as hh:mm:ss
  • time since last boot formated as hh:mm:ss
  • days (only shown if days > 0) formated as x days

usage example
C:\>uptime
 08:20:14 uptime 08:48:27
C:\>

Calculation of Uptime
The calculation of uptime (v1.1.x) is based on the difference of the LastBootupTime obtained from Windows Management Instrumentation (WMI) and the current local time.

1.0.x Versions are based on the difference of the starting date of the eventlog service to the current local time to determine the days value. The difference of the global TickCount of windows is used to determine hours, minutes, seconds and milliseconds.

To "just Windows" Windows User
uptime.exe is a console application. If you double click the icon of the executable in an explorer window you would see nothing! To use uptime.exe you have to open a command prompt. A fast way to open a console is to press (Win+R) and type "cmd".

Requires .NET
uptime.exe requires at least an installed .NET Framework 2.0 or newer. If not already done, you may have to install it on your own. On Windows 8, Windows 7 and Vista it should work out of the box.

It's free. Enjoy!

Last edited Aug 13, 2013 at 7:37 PM by StanleyJobbson, version 31