Getting the Uptime in Windows

Printer-friendly version

Windows ships without the uptime reporting ability that is standard in Linuxi. I've gotten so used to checking the uptime on my Linux boxes (for various reasons) that I occasionally want to do the same on my windows machine. There are a few utilities that you can download but there is a way built into windows. With my tongue slightly in my cheek I suspect Microsoft didn't make it easy because their OS never seldom has a reasonable uptime.
All you need to do is create a batch file which I called uptime.bat Then we're going to gather a system information report and pull out only the information I want. I stored the batch file in the system32 directory because it's already in the path. I know someone is going to go nuts over that and that's fine for you. This is what I did.

To accomplish the following Click START> RUN and then type the following
notepad c:\windows\system32\uptime.bat
Then insert this simple command as the only line of the batch file
systeminfo |find "Up Time" |msg *
What it does is start the systeminfo program which is pretty handy. The first pipe pulls out only the line which reports uptime. The second pipe feeds that result into a message box.
Feel free to experiment.
If you don't want to mess with it, just download my batch file.

Have a nice day.

Comments

Working at a Helpdesk, I am often confronted with user who (I can't make this stuff up, folks) think that turning the monitor off is shutting down the computer. If I ask them when they last rebooted, I often get "This morning".

Years ago, I found a tool on SysInternals called Uptime. It is a command-line tool, but is pretty easy to use. Simply type "uptime /s [machine name or IP]". The "/s" give the detailed boot record. Users are pretty amazed when I tell them the exact date and time of the last reboot.

There are lots of others, but this one is my favorite!

tcblack's picture

I'm guessing that uptime has been superseded by psinfo (http://technet.microsoft.com/en-us/sysinternals/bb897550.aspx) since nowhere on the sysinternals MS site is there a utility called uptime.
But yes, Sysinternals has long held the corner on the right tools for this type of job.