WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

System_Diagnostics

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

System Uptime

 Keywords: System.Diagnostics.PerformanceCounter Diagnostics PerformanceCounter System Up Time Uptime GetTickCount Exclude Suspended Hibernation

This gives you the System Up Time without including the time the OS may have been suspended or in hibernation.
  
; Get an instance of the System Up Time performance counter.
ObjectClrOption("use", "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
UpTime = ObjectClrNew("System.Diagnostics.PerformanceCounter", "System", "System Up Time", "")

; Two read counter.
UpTime.NextValue();
nSecs = UpTime.NextValue()
UpTime.Close()

Message("System Up Time", nSecs: " Seconds")

Article ID:   W17818
Filename:   System Uptime.txt
File Created: 2013:06:10:10:50:32
Last Updated: 2013:06:10:10:50:32