Getting the Uptime in Windows


Windows ships without the uptime reporting ability that is standard in Linux. 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.