uptime for Win XP?
rtilley at vt.edu
Sun Dec 12 22:57:28 CET 2004
Esmail Bonakdarian wrote:
> Is there a way to display how long a Win XP system has been up?
> Somewhat analogous to the *nix uptime command.
Just run the built-in Windows utility 'systeminfo' from a cmd prompt.
Python can call 'systeminfo' like this:
uptime = os.popen('systeminfo', 'r')
data = uptime.readlines()
for line in data:
if line contains "System Up Time":
Please note that 'systeminfo' is only present on Windows XP PRO and
Windows Server 2003... Windows XP HOME does not have this command.
More information about the Python-list