Get Windows PC Uptime using JAVA


This code snippest is about getting the system uptime using JAVA. The way it works is we invoke net stats srv from java using, JAVA Runtime. The command returns the time that the PC has been up for, A sample command in a windows system looks like, Microsoft Windows [Version 10.0.10240] (c) 2015 Microsoft Corporation. All rights reserved. C:\Users\user>net stats srv Server Statistics for \\DESKTOP-****** Statistics since 3/31/2020 8:49:26 PM Sessions accepted 0 Sessions timed-out 0 Sessions errored-out 0 Kilobytes sent 60 Kilobytes received 53 Mean response time (msec) 0…

Read More