How to get the system uptime in Windows? - Stack Overflow
Posted: Sunday, July 16, 2017 by Tyler Durden in
How to get the system uptime in Windows? - Stack Overflow
Following are seven ways to find the Uptime in Windows OS. 1: By using the Task ManagerIn Windows Vista and Windows Server 2008, the Task Manager has been beefed up to show additional information about the system. One of these pieces of info is the server’s running time.
2: By using the System Information UtilityThe systeminfo command line utility checks and displays various system statistics such as installation date, installed hotfixes and more. Open a Command Prompt and type the following command:
You can also narrow down the results to just the line you need:
3: By using the Uptime UtilityMicrosoft have published a tool called Uptime.exe. It is a simple command line tool that analyses the computer's reliability and availability information. It can work locally or remotely. In its simple form, the tool will display the current system uptime. An advanced option allows you to access more detailed information such as shutdown, reboots, operating system crashes, and Service Pack installation. Read the following KB for more info and for the download links:
To use it, follow these steps:
It does not offer many command line parameters:
3.1: By using the old Uptime UtilityThere is an older version of the "uptime.exe" utility. This has the advantage of NOT needing .NET. (It also has a lot more features beyond simple uptime.) Download link: Windows NT 4.0 Server Uptime Tool (uptime.exe) (final x86)
4: By using the NET STATISTICS UtilityAnother easy method, if you can remember it, is to use the approximate information found in the statistics displayed by the NET STATISTICS command. Open a Command Prompt and type the following command:
The statistics should tell you how long it’s been running, although in some cases this information is not as accurate as other methods. 5: By Using the Event ViewerProbably the most accurate of them all, but it does require some clicking. It does not display an exact day or hour count since the last reboot, but it will display important information regarding why the computer was rebooted and when it did so. We need to look at Event ID 6005, which is an event that tells us that the computer has just finished booting, but you should be aware of the fact that there are virtually hundreds if not thousands of other event types that you could potentially learn from. Note: BTW, the 6006 Event ID is what tells us when the server has gone down, so if there’s much time difference between the 6006 and 6005 events, the server was down for a long time. Note: You can also open the Event Viewer by typing eventvwr.msc in the Run command, and you might as well use the shortcut found in the Administrative tools folder.
5.1: Eventlog via PowerShell
6: Programmatically, by using GetTickCount64
7: By using WMI
| |||
systeminfo
and check the whole output – FelixD Mar 25 '14 at 9:04